use ::libc;
extern "C" {
    pub type event_base;
    pub type evbuffer;
    pub type bufferevent_ops;
    pub type args;
    pub type tmuxpeer;
    pub type hyperlinks;
    pub type screen_write_cline;
    pub type screen_sel;
    pub type screen_titles;
    pub type environ;
    pub type options;
    pub type format_tree;
    pub type input_ctx;
    pub type cmds;
    pub type tty_key;
    pub type tty_code;
    pub type format_job_tree;
    pub type control_state;
    pub type cmdq_list;
    pub type cmdq_item;
    pub type cmdq_state;
    pub type screen_write_citem;
    fn toupper(_: i32) -> i32;
    fn free(_: *mut libc::c_void);
    fn memcpy(_: *mut libc::c_void, _: *const libc::c_void, _: u64) -> *mut libc::c_void;
    fn strstr(_: *const i8, _: *const i8) -> *mut i8;
    fn strlen(_: *const i8) -> u64;
    fn strcasecmp(_: *const i8, _: *const i8) -> i32;
    fn strlcat(_: *mut i8, _: *const i8, _: size_t) -> size_t;
    fn xmalloc(_: size_t) -> *mut libc::c_void;
    fn xcalloc(_: size_t, _: size_t) -> *mut libc::c_void;
    fn xreallocarray(_: *mut libc::c_void, _: size_t, _: size_t) -> *mut libc::c_void;
    fn xstrdup(_: *const i8) -> *mut i8;
    fn xasprintf(_: *mut *mut i8, _: *const i8, _: ...) -> i32;
    fn format_draw(
        _: *mut screen_write_ctx,
        _: *const grid_cell,
        _: u_int,
        _: *const i8,
        _: *mut style_ranges,
        _: i32,
    );
    fn args_has(_: *mut args, _: u_char) -> i32;
    fn args_get(_: *mut args, _: u_char) -> *const i8;
    fn cmd_mouse_at(
        _: *mut window_pane,
        _: *mut mouse_event,
        _: *mut u_int,
        _: *mut u_int,
        _: i32,
    ) -> i32;
    fn cmd_template_replace(
        _: *const i8,
        _: *const i8,
        _: i32,
    ) -> *mut i8;
    fn cmd_parse_and_append(
        _: *const i8,
        _: *mut cmd_parse_input,
        _: *mut client,
        _: *mut cmdq_state,
        _: *mut *mut i8,
    ) -> cmd_parse_status;
    fn cmdq_new_state(_: *mut cmd_find_state, _: *mut key_event, _: i32)
        -> *mut cmdq_state;
    fn cmdq_free_state(_: *mut cmdq_state);
    fn key_string_lookup_key(_: key_code, _: i32) -> *const i8;
    fn server_redraw_window(_: *mut window);
    fn server_unzoom_window(_: *mut window);
    fn status_message_set(
        _: *mut client,
        _: i32,
        _: i32,
        _: i32,
        _: *const i8,
        _: ...
    );
    fn status_prompt_set(
        _: *mut client,
        _: *mut cmd_find_state,
        _: *const i8,
        _: *const i8,
        _: prompt_input_cb,
        _: prompt_free_cb,
        _: *mut libc::c_void,
        _: i32,
        _: prompt_type,
    );
    static grid_default_cell: grid_cell;
    fn screen_write_start(_: *mut screen_write_ctx, _: *mut screen);
    fn screen_write_stop(_: *mut screen_write_ctx);
    fn screen_write_puts(
        _: *mut screen_write_ctx,
        _: *const grid_cell,
        _: *const i8,
        _: ...
    );
    fn screen_write_nputs(
        _: *mut screen_write_ctx,
        _: ssize_t,
        _: *const grid_cell,
        _: *const i8,
        _: ...
    );
    fn screen_write_box(
        _: *mut screen_write_ctx,
        _: u_int,
        _: u_int,
        _: box_lines,
        _: *const grid_cell,
        _: *const i8,
    );
    fn screen_write_clearendofline(_: *mut screen_write_ctx, _: u_int);
    fn screen_write_cursormove(
        _: *mut screen_write_ctx,
        _: i32,
        _: i32,
        _: i32,
    );
    fn screen_write_clearscreen(_: *mut screen_write_ctx, _: u_int);
    fn screen_init(_: *mut screen, _: u_int, _: u_int, _: u_int);
    fn screen_free(_: *mut screen);
    fn screen_resize(_: *mut screen, _: u_int, _: u_int, _: i32);
    fn window_zoom(_: *mut window_pane) -> i32;
    fn utf8_cstrwidth(_: *const i8) -> u_int;
    fn style_apply(_: *mut grid_cell, _: *mut options, _: *const i8, _: *mut format_tree);
    fn log_debug(_: *const i8, _: ...);
    fn menu_free(_: *mut menu);
    fn menu_display(
        _: *mut menu,
        _: i32,
        _: i32,
        _: *mut cmdq_item,
        _: u_int,
        _: u_int,
        _: *mut client,
        _: box_lines,
        _: *const i8,
        _: *const i8,
        _: *const i8,
        _: *mut cmd_find_state,
        _: menu_choice_cb,
        _: *mut libc::c_void,
    ) -> i32;
    fn menu_add_items(
        _: *mut menu,
        _: *const menu_item,
        _: *mut cmdq_item,
        _: *mut client,
        _: *mut cmd_find_state,
    );
    fn menu_create(_: *const i8) -> *mut menu;
}
pub type __u_char = u8;
pub type __u_short = u16;
pub type __u_int = u32;
pub type __uint8_t = u8;
pub type __uint64_t = u64;
pub type __pid_t = i32;
pub type __time_t = i64;
pub type __suseconds_t = i64;
pub type __ssize_t = i64;
pub type u_char = __u_char;
pub type u_short = __u_short;
pub type u_int = __u_int;
pub type pid_t = __pid_t;
pub type ssize_t = __ssize_t;
pub type time_t = __time_t;
pub type size_t = u64;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct timeval {
    pub tv_sec: __time_t,
    pub tv_usec: __suseconds_t,
}
pub type cc_t = u8;
pub type speed_t = u32;
pub type tcflag_t = u32;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct termios {
    pub c_iflag: tcflag_t,
    pub c_oflag: tcflag_t,
    pub c_cflag: tcflag_t,
    pub c_lflag: tcflag_t,
    pub c_line: cc_t,
    pub c_cc: [cc_t; 32],
    pub c_ispeed: speed_t,
    pub c_ospeed: speed_t,
}
pub type uint8_t = __uint8_t;
pub type uint64_t = __uint64_t;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct event {
    pub ev_evcallback: event_callback,
    pub ev_timeout_pos: C2RustUnnamed_4,
    pub ev_fd: i32,
    pub ev_base: *mut event_base,
    pub ev_: C2RustUnnamed,
    pub ev_events: i16,
    pub ev_res: i16,
    pub ev_timeout: timeval,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub union C2RustUnnamed {
    pub ev_io: C2RustUnnamed_2,
    pub ev_signal: C2RustUnnamed_0,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_0 {
    pub ev_signal_next: C2RustUnnamed_1,
    pub ev_ncalls: i16,
    pub ev_pncalls: *mut i16,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_1 {
    pub le_next: *mut event,
    pub le_prev: *mut *mut event,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_2 {
    pub ev_io_next: C2RustUnnamed_3,
    pub ev_timeout: timeval,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_3 {
    pub le_next: *mut event,
    pub le_prev: *mut *mut event,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub union C2RustUnnamed_4 {
    pub ev_next_with_common_timeout: C2RustUnnamed_5,
    pub min_heap_idx: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_5 {
    pub tqe_next: *mut event,
    pub tqe_prev: *mut *mut event,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct event_callback {
    pub evcb_active_next: C2RustUnnamed_7,
    pub evcb_flags: i16,
    pub evcb_pri: uint8_t,
    pub evcb_closure: uint8_t,
    pub evcb_cb_union: C2RustUnnamed_6,
    pub evcb_arg: *mut libc::c_void,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub union C2RustUnnamed_6 {
    pub evcb_callback:
        Option<unsafe extern "C" fn(i32, i16, *mut libc::c_void) -> ()>,
    pub evcb_selfcb: Option<unsafe extern "C" fn(*mut event_callback, *mut libc::c_void) -> ()>,
    pub evcb_evfinalize: Option<unsafe extern "C" fn(*mut event, *mut libc::c_void) -> ()>,
    pub evcb_cbfinalize: Option<unsafe extern "C" fn(*mut event_callback, *mut libc::c_void) -> ()>,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_7 {
    pub tqe_next: *mut event_callback,
    pub tqe_prev: *mut *mut event_callback,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct bufferevent {
    pub ev_base: *mut event_base,
    pub be_ops: *const bufferevent_ops,
    pub ev_read: event,
    pub ev_write: event,
    pub input: *mut evbuffer,
    pub output: *mut evbuffer,
    pub wm_read: event_watermark,
    pub wm_write: event_watermark,
    pub readcb: bufferevent_data_cb,
    pub writecb: bufferevent_data_cb,
    pub errorcb: bufferevent_event_cb,
    pub cbarg: *mut libc::c_void,
    pub timeout_read: timeval,
    pub timeout_write: timeval,
    pub enabled: i16,
}
pub type bufferevent_event_cb =
    Option<unsafe extern "C" fn(*mut bufferevent, i16, *mut libc::c_void) -> ()>;
pub type bufferevent_data_cb =
    Option<unsafe extern "C" fn(*mut bufferevent, *mut libc::c_void) -> ()>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct event_watermark {
    pub low: size_t,
    pub high: size_t,
}
pub type bitstr_t = u8;
pub type msgtype = u32;
pub const MSG_READ_CANCEL: msgtype = 307;
pub const MSG_WRITE_CLOSE: msgtype = 306;
pub const MSG_WRITE_READY: msgtype = 305;
pub const MSG_WRITE: msgtype = 304;
pub const MSG_WRITE_OPEN: msgtype = 303;
pub const MSG_READ_DONE: msgtype = 302;
pub const MSG_READ: msgtype = 301;
pub const MSG_READ_OPEN: msgtype = 300;
pub const MSG_FLAGS: msgtype = 218;
pub const MSG_EXEC: msgtype = 217;
pub const MSG_WAKEUP: msgtype = 216;
pub const MSG_UNLOCK: msgtype = 215;
pub const MSG_SUSPEND: msgtype = 214;
pub const MSG_OLDSTDOUT: msgtype = 213;
pub const MSG_OLDSTDIN: msgtype = 212;
pub const MSG_OLDSTDERR: msgtype = 211;
pub const MSG_SHUTDOWN: msgtype = 210;
pub const MSG_SHELL: msgtype = 209;
pub const MSG_RESIZE: msgtype = 208;
pub const MSG_READY: msgtype = 207;
pub const MSG_LOCK: msgtype = 206;
pub const MSG_EXITING: msgtype = 205;
pub const MSG_EXITED: msgtype = 204;
pub const MSG_EXIT: msgtype = 203;
pub const MSG_DETACHKILL: msgtype = 202;
pub const MSG_DETACH: msgtype = 201;
pub const MSG_COMMAND: msgtype = 200;
pub const MSG_IDENTIFY_TERMINFO: msgtype = 112;
pub const MSG_IDENTIFY_LONGFLAGS: msgtype = 111;
pub const MSG_IDENTIFY_STDOUT: msgtype = 110;
pub const MSG_IDENTIFY_FEATURES: msgtype = 109;
pub const MSG_IDENTIFY_CWD: msgtype = 108;
pub const MSG_IDENTIFY_CLIENTPID: msgtype = 107;
pub const MSG_IDENTIFY_DONE: msgtype = 106;
pub const MSG_IDENTIFY_ENVIRON: msgtype = 105;
pub const MSG_IDENTIFY_STDIN: msgtype = 104;
pub const MSG_IDENTIFY_OLDCWD: msgtype = 103;
pub const MSG_IDENTIFY_TTYNAME: msgtype = 102;
pub const MSG_IDENTIFY_TERM: msgtype = 101;
pub const MSG_IDENTIFY_FLAGS: msgtype = 100;
pub const MSG_VERSION: msgtype = 12;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct client {
    pub name: *const i8,
    pub peer: *mut tmuxpeer,
    pub queue: *mut cmdq_list,
    pub windows: client_windows,
    pub control_state: *mut control_state,
    pub pause_age: u_int,
    pub pid: pid_t,
    pub fd: i32,
    pub out_fd: i32,
    pub event: event,
    pub retval: i32,
    pub creation_time: timeval,
    pub activity_time: timeval,
    pub last_activity_time: timeval,
    pub environ: *mut environ,
    pub jobs: *mut format_job_tree,
    pub title: *mut i8,
    pub path: *mut i8,
    pub cwd: *const i8,
    pub term_name: *mut i8,
    pub term_features: i32,
    pub term_type: *mut i8,
    pub term_caps: *mut *mut i8,
    pub term_ncaps: u_int,
    pub ttyname: *mut i8,
    pub tty: tty,
    pub written: size_t,
    pub discarded: size_t,
    pub redraw: size_t,
    pub repeat_timer: event,
    pub click_timer: event,
    pub click_button: u_int,
    pub click_event: mouse_event,
    pub status: status_line,
    pub flags: uint64_t,
    pub exit_type: C2RustUnnamed_30,
    pub exit_msgtype: msgtype,
    pub exit_session: *mut i8,
    pub exit_message: *mut i8,
    pub keytable: *mut key_table,
    pub last_key: key_code,
    pub redraw_panes: uint64_t,
    pub redraw_scrollbars: uint64_t,
    pub message_ignore_keys: i32,
    pub message_ignore_styles: i32,
    pub message_string: *mut i8,
    pub message_timer: event,
    pub prompt_string: *mut i8,
    pub prompt_buffer: *mut utf8_data,
    pub prompt_last: *mut i8,
    pub prompt_index: size_t,
    pub prompt_inputcb: prompt_input_cb,
    pub prompt_freecb: prompt_free_cb,
    pub prompt_data: *mut libc::c_void,
    pub prompt_hindex: [u_int; 4],
    pub prompt_mode: C2RustUnnamed_27,
    pub prompt_saved: *mut utf8_data,
    pub prompt_flags: i32,
    pub prompt_type: prompt_type,
    pub prompt_cursor: i32,
    pub session: *mut session,
    pub last_session: *mut session,
    pub references: i32,
    pub pan_window: *mut libc::c_void,
    pub pan_ox: u_int,
    pub pan_oy: u_int,
    pub overlay_check: overlay_check_cb,
    pub overlay_mode: overlay_mode_cb,
    pub overlay_draw: overlay_draw_cb,
    pub overlay_key: overlay_key_cb,
    pub overlay_free: overlay_free_cb,
    pub overlay_resize: overlay_resize_cb,
    pub overlay_data: *mut libc::c_void,
    pub overlay_timer: event,
    pub files: client_files,
    pub clipboard_panes: *mut u_int,
    pub clipboard_npanes: u_int,
    pub entry: C2RustUnnamed_8,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_8 {
    pub tqe_next: *mut client,
    pub tqe_prev: *mut *mut client,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct client_files {
    pub rbh_root: *mut client_file,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct client_file {
    pub c: *mut client,
    pub peer: *mut tmuxpeer,
    pub tree: *mut client_files,
    pub references: i32,
    pub stream: i32,
    pub path: *mut i8,
    pub buffer: *mut evbuffer,
    pub event: *mut bufferevent,
    pub fd: i32,
    pub error: i32,
    pub closed: i32,
    pub cb: client_file_cb,
    pub data: *mut libc::c_void,
    pub entry: C2RustUnnamed_9,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_9 {
    pub rbe_left: *mut client_file,
    pub rbe_right: *mut client_file,
    pub rbe_parent: *mut client_file,
    pub rbe_color: i32,
}
pub type client_file_cb = Option<
    unsafe extern "C" fn(
        *mut client,
        *const i8,
        i32,
        i32,
        *mut evbuffer,
        *mut libc::c_void,
    ) -> (),
>;
pub type overlay_resize_cb = Option<unsafe extern "C" fn(*mut client, *mut libc::c_void) -> ()>;
pub type overlay_free_cb = Option<unsafe extern "C" fn(*mut client, *mut libc::c_void) -> ()>;
pub type overlay_key_cb =
    Option<unsafe extern "C" fn(*mut client, *mut libc::c_void, *mut key_event) -> i32>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct key_event {
    pub key: key_code,
    pub m: mouse_event,
    pub buf: *mut i8,
    pub len: size_t,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct mouse_event {
    pub valid: i32,
    pub ignore: i32,
    pub key: key_code,
    pub statusat: i32,
    pub statuslines: u_int,
    pub x: u_int,
    pub y: u_int,
    pub b: u_int,
    pub lx: u_int,
    pub ly: u_int,
    pub lb: u_int,
    pub ox: u_int,
    pub oy: u_int,
    pub s: i32,
    pub w: i32,
    pub wp: i32,
    pub sgr_type: u_int,
    pub sgr_b: u_int,
}
pub type key_code = u64;
pub type overlay_draw_cb =
    Option<unsafe extern "C" fn(*mut client, *mut libc::c_void, *mut screen_redraw_ctx) -> ()>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct screen_redraw_ctx {
    pub c: *mut client,
    pub statuslines: u_int,
    pub statustop: i32,
    pub pane_status: i32,
    pub pane_lines: pane_lines,
    pub pane_scrollbars: i32,
    pub pane_scrollbars_pos: i32,
    pub no_pane_gc: grid_cell,
    pub no_pane_gc_set: i32,
    pub sx: u_int,
    pub sy: u_int,
    pub ox: u_int,
    pub oy: u_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct grid_cell {
    pub data: utf8_data,
    pub attr: u_short,
    pub flags: u_char,
    pub fg: i32,
    pub bg: i32,
    pub us: i32,
    pub link: u_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct utf8_data {
    pub data: [u_char; 21],
    pub have: u_char,
    pub size: u_char,
    pub width: u_char,
}
pub type pane_lines = u32;
pub const PANE_LINES_NUMBER: pane_lines = 4;
pub const PANE_LINES_SIMPLE: pane_lines = 3;
pub const PANE_LINES_HEAVY: pane_lines = 2;
pub const PANE_LINES_DOUBLE: pane_lines = 1;
pub const PANE_LINES_SINGLE: pane_lines = 0;
pub type overlay_mode_cb = Option<
    unsafe extern "C" fn(*mut client, *mut libc::c_void, *mut u_int, *mut u_int) -> *mut screen,
>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct screen {
    pub title: *mut i8,
    pub path: *mut i8,
    pub titles: *mut screen_titles,
    pub grid: *mut grid,
    pub cx: u_int,
    pub cy: u_int,
    pub cstyle: screen_cursor_style,
    pub default_cstyle: screen_cursor_style,
    pub ccolour: i32,
    pub default_ccolour: i32,
    pub rupper: u_int,
    pub rlower: u_int,
    pub mode: i32,
    pub default_mode: i32,
    pub saved_cx: u_int,
    pub saved_cy: u_int,
    pub saved_grid: *mut grid,
    pub saved_cell: grid_cell,
    pub saved_flags: i32,
    pub tabs: *mut bitstr_t,
    pub sel: *mut screen_sel,
    pub write_list: *mut screen_write_cline,
    pub hyperlinks: *mut hyperlinks,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct grid {
    pub flags: i32,
    pub sx: u_int,
    pub sy: u_int,
    pub hscrolled: u_int,
    pub hsize: u_int,
    pub hlimit: u_int,
    pub linedata: *mut grid_line,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct grid_line {
    pub celldata: *mut grid_cell_entry,
    pub cellused: u_int,
    pub cellsize: u_int,
    pub extddata: *mut grid_extd_entry,
    pub extdsize: u_int,
    pub flags: i32,
    pub time: time_t,
}
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct grid_extd_entry {
    pub data: utf8_char,
    pub attr: u_short,
    pub flags: u_char,
    pub fg: i32,
    pub bg: i32,
    pub us: i32,
    pub link: u_int,
}
pub type utf8_char = u_int;
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct grid_cell_entry {
    pub c2rust_unnamed: C2RustUnnamed_10,
    pub flags: u_char,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub union C2RustUnnamed_10 {
    pub offset: u_int,
    pub data: C2RustUnnamed_11,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_11 {
    pub attr: u_char,
    pub fg: u_char,
    pub bg: u_char,
    pub data: u_char,
}
pub type screen_cursor_style = u32;
pub const SCREEN_CURSOR_BAR: screen_cursor_style = 3;
pub const SCREEN_CURSOR_UNDERLINE: screen_cursor_style = 2;
pub const SCREEN_CURSOR_BLOCK: screen_cursor_style = 1;
pub const SCREEN_CURSOR_DEFAULT: screen_cursor_style = 0;
pub type overlay_check_cb = Option<
    unsafe extern "C" fn(
        *mut client,
        *mut libc::c_void,
        u_int,
        u_int,
        u_int,
        *mut overlay_ranges,
    ) -> (),
>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct overlay_ranges {
    pub px: [u_int; 3],
    pub nx: [u_int; 3],
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct session {
    pub id: u_int,
    pub name: *mut i8,
    pub cwd: *const i8,
    pub creation_time: timeval,
    pub last_attached_time: timeval,
    pub activity_time: timeval,
    pub last_activity_time: timeval,
    pub lock_timer: event,
    pub curw: *mut winlink,
    pub lastw: winlink_stack,
    pub windows: winlinks,
    pub statusat: i32,
    pub statuslines: u_int,
    pub options: *mut options,
    pub flags: i32,
    pub attached: u_int,
    pub tio: *mut termios,
    pub environ: *mut environ,
    pub references: i32,
    pub gentry: C2RustUnnamed_13,
    pub entry: C2RustUnnamed_12,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_12 {
    pub rbe_left: *mut session,
    pub rbe_right: *mut session,
    pub rbe_parent: *mut session,
    pub rbe_color: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_13 {
    pub tqe_next: *mut session,
    pub tqe_prev: *mut *mut session,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct winlinks {
    pub rbh_root: *mut winlink,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct winlink {
    pub idx: i32,
    pub session: *mut session,
    pub window: *mut window,
    pub flags: i32,
    pub entry: C2RustUnnamed_16,
    pub wentry: C2RustUnnamed_15,
    pub sentry: C2RustUnnamed_14,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_14 {
    pub tqe_next: *mut winlink,
    pub tqe_prev: *mut *mut winlink,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_15 {
    pub tqe_next: *mut winlink,
    pub tqe_prev: *mut *mut winlink,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_16 {
    pub rbe_left: *mut winlink,
    pub rbe_right: *mut winlink,
    pub rbe_parent: *mut winlink,
    pub rbe_color: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window {
    pub id: u_int,
    pub latest: *mut libc::c_void,
    pub name: *mut i8,
    pub name_event: event,
    pub name_time: timeval,
    pub alerts_timer: event,
    pub offset_timer: event,
    pub activity_time: timeval,
    pub active: *mut window_pane,
    pub last_panes: window_panes,
    pub panes: window_panes,
    pub lastlayout: i32,
    pub layout_root: *mut layout_cell,
    pub saved_layout_root: *mut layout_cell,
    pub old_layout: *mut i8,
    pub sx: u_int,
    pub sy: u_int,
    pub manual_sx: u_int,
    pub manual_sy: u_int,
    pub xpixel: u_int,
    pub ypixel: u_int,
    pub new_sx: u_int,
    pub new_sy: u_int,
    pub new_xpixel: u_int,
    pub new_ypixel: u_int,
    pub fill_character: *mut utf8_data,
    pub flags: i32,
    pub alerts_queued: i32,
    pub alerts_entry: C2RustUnnamed_19,
    pub options: *mut options,
    pub references: u_int,
    pub winlinks: C2RustUnnamed_18,
    pub entry: C2RustUnnamed_17,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_17 {
    pub rbe_left: *mut window,
    pub rbe_right: *mut window,
    pub rbe_parent: *mut window,
    pub rbe_color: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_18 {
    pub tqh_first: *mut winlink,
    pub tqh_last: *mut *mut winlink,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_19 {
    pub tqe_next: *mut window,
    pub tqe_prev: *mut *mut window,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct layout_cell {
    pub type_0: layout_type,
    pub parent: *mut layout_cell,
    pub sx: u_int,
    pub sy: u_int,
    pub xoff: u_int,
    pub yoff: u_int,
    pub wp: *mut window_pane,
    pub cells: layout_cells,
    pub entry: C2RustUnnamed_20,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_20 {
    pub tqe_next: *mut layout_cell,
    pub tqe_prev: *mut *mut layout_cell,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct layout_cells {
    pub tqh_first: *mut layout_cell,
    pub tqh_last: *mut *mut layout_cell,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_pane {
    pub id: u_int,
    pub active_point: u_int,
    pub window: *mut window,
    pub options: *mut options,
    pub layout_cell: *mut layout_cell,
    pub saved_layout_cell: *mut layout_cell,
    pub sx: u_int,
    pub sy: u_int,
    pub xoff: u_int,
    pub yoff: u_int,
    pub flags: i32,
    pub sb_slider_y: u_int,
    pub sb_slider_h: u_int,
    pub argc: i32,
    pub argv: *mut *mut i8,
    pub shell: *mut i8,
    pub cwd: *mut i8,
    pub pid: pid_t,
    pub tty: [i8; 32],
    pub status: i32,
    pub dead_time: timeval,
    pub fd: i32,
    pub event: *mut bufferevent,
    pub offset: window_pane_offset,
    pub base_offset: size_t,
    pub resize_queue: window_pane_resizes,
    pub resize_timer: event,
    pub ictx: *mut input_ctx,
    pub cached_gc: grid_cell,
    pub cached_active_gc: grid_cell,
    pub palette: colour_palette,
    pub pipe_fd: i32,
    pub pipe_event: *mut bufferevent,
    pub pipe_offset: window_pane_offset,
    pub screen: *mut screen,
    pub base: screen,
    pub status_screen: screen,
    pub status_size: size_t,
    pub modes: C2RustUnnamed_24,
    pub searchstr: *mut i8,
    pub searchregex: i32,
    pub border_gc_set: i32,
    pub border_gc: grid_cell,
    pub control_bg: i32,
    pub control_fg: i32,
    pub scrollbar_style: style,
    pub entry: C2RustUnnamed_23,
    pub sentry: C2RustUnnamed_22,
    pub tree_entry: C2RustUnnamed_21,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_21 {
    pub rbe_left: *mut window_pane,
    pub rbe_right: *mut window_pane,
    pub rbe_parent: *mut window_pane,
    pub rbe_color: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_22 {
    pub tqe_next: *mut window_pane,
    pub tqe_prev: *mut *mut window_pane,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_23 {
    pub tqe_next: *mut window_pane,
    pub tqe_prev: *mut *mut window_pane,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct style {
    pub gc: grid_cell,
    pub ignore: i32,
    pub fill: i32,
    pub align: style_align,
    pub list: style_list,
    pub range_type: style_range_type,
    pub range_argument: u_int,
    pub range_string: [i8; 16],
    pub width: i32,
    pub pad: i32,
    pub default_type: style_default_type,
}
pub type style_default_type = u32;
pub const STYLE_DEFAULT_POP: style_default_type = 2;
pub const STYLE_DEFAULT_PUSH: style_default_type = 1;
pub const STYLE_DEFAULT_BASE: style_default_type = 0;
pub type style_range_type = u32;
pub const STYLE_RANGE_USER: style_range_type = 6;
pub const STYLE_RANGE_SESSION: style_range_type = 5;
pub const STYLE_RANGE_WINDOW: style_range_type = 4;
pub const STYLE_RANGE_PANE: style_range_type = 3;
pub const STYLE_RANGE_RIGHT: style_range_type = 2;
pub const STYLE_RANGE_LEFT: style_range_type = 1;
pub const STYLE_RANGE_NONE: style_range_type = 0;
pub type style_list = u32;
pub const STYLE_LIST_RIGHT_MARKER: style_list = 4;
pub const STYLE_LIST_LEFT_MARKER: style_list = 3;
pub const STYLE_LIST_FOCUS: style_list = 2;
pub const STYLE_LIST_ON: style_list = 1;
pub const STYLE_LIST_OFF: style_list = 0;
pub type style_align = u32;
pub const STYLE_ALIGN_ABSOLUTE_CENTRE: style_align = 4;
pub const STYLE_ALIGN_RIGHT: style_align = 3;
pub const STYLE_ALIGN_CENTRE: style_align = 2;
pub const STYLE_ALIGN_LEFT: style_align = 1;
pub const STYLE_ALIGN_DEFAULT: style_align = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_24 {
    pub tqh_first: *mut window_mode_entry,
    pub tqh_last: *mut *mut window_mode_entry,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_mode_entry {
    pub wp: *mut window_pane,
    pub swp: *mut window_pane,
    pub mode: *const window_mode,
    pub data: *mut libc::c_void,
    pub screen: *mut screen,
    pub prefix: u_int,
    pub entry: C2RustUnnamed_25,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_25 {
    pub tqe_next: *mut window_mode_entry,
    pub tqe_prev: *mut *mut window_mode_entry,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_mode {
    pub name: *const i8,
    pub default_format: *const i8,
    pub init: Option<
        unsafe extern "C" fn(*mut window_mode_entry, *mut cmd_find_state, *mut args) -> *mut screen,
    >,
    pub free: Option<unsafe extern "C" fn(*mut window_mode_entry) -> ()>,
    pub resize: Option<unsafe extern "C" fn(*mut window_mode_entry, u_int, u_int) -> ()>,
    pub update: Option<unsafe extern "C" fn(*mut window_mode_entry) -> ()>,
    pub key: Option<
        unsafe extern "C" fn(
            *mut window_mode_entry,
            *mut client,
            *mut session,
            *mut winlink,
            key_code,
            *mut mouse_event,
        ) -> (),
    >,
    pub key_table: Option<unsafe extern "C" fn(*mut window_mode_entry) -> *const i8>,
    pub command: Option<
        unsafe extern "C" fn(
            *mut window_mode_entry,
            *mut client,
            *mut session,
            *mut winlink,
            *mut args,
            *mut mouse_event,
        ) -> (),
    >,
    pub formats: Option<unsafe extern "C" fn(*mut window_mode_entry, *mut format_tree) -> ()>,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct cmd_find_state {
    pub flags: i32,
    pub current: *mut cmd_find_state,
    pub s: *mut session,
    pub wl: *mut winlink,
    pub w: *mut window,
    pub wp: *mut window_pane,
    pub idx: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_pane_offset {
    pub used: size_t,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct colour_palette {
    pub fg: i32,
    pub bg: i32,
    pub palette: *mut i32,
    pub default_palette: *mut i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_pane_resizes {
    pub tqh_first: *mut window_pane_resize,
    pub tqh_last: *mut *mut window_pane_resize,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_pane_resize {
    pub sx: u_int,
    pub sy: u_int,
    pub osx: u_int,
    pub osy: u_int,
    pub entry: C2RustUnnamed_26,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_26 {
    pub tqe_next: *mut window_pane_resize,
    pub tqe_prev: *mut *mut window_pane_resize,
}
pub type layout_type = u32;
pub const LAYOUT_WINDOWPANE: layout_type = 2;
pub const LAYOUT_TOPBOTTOM: layout_type = 1;
pub const LAYOUT_LEFTRIGHT: layout_type = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_panes {
    pub tqh_first: *mut window_pane,
    pub tqh_last: *mut *mut window_pane,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct winlink_stack {
    pub tqh_first: *mut winlink,
    pub tqh_last: *mut *mut winlink,
}
pub type prompt_type = u32;
pub const PROMPT_TYPE_INVALID: prompt_type = 255;
pub const PROMPT_TYPE_WINDOW_TARGET: prompt_type = 3;
pub const PROMPT_TYPE_TARGET: prompt_type = 2;
pub const PROMPT_TYPE_SEARCH: prompt_type = 1;
pub const PROMPT_TYPE_COMMAND: prompt_type = 0;
pub type C2RustUnnamed_27 = u32;
pub const PROMPT_COMMAND: C2RustUnnamed_27 = 1;
pub const PROMPT_ENTRY: C2RustUnnamed_27 = 0;
pub type prompt_free_cb = Option<unsafe extern "C" fn(*mut libc::c_void) -> ()>;
pub type prompt_input_cb = Option<
    unsafe extern "C" fn(
        *mut client,
        *mut libc::c_void,
        *const i8,
        i32,
    ) -> i32,
>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct key_table {
    pub name: *const i8,
    pub activity_time: timeval,
    pub key_bindings: key_bindings,
    pub default_key_bindings: key_bindings,
    pub references: u_int,
    pub entry: C2RustUnnamed_28,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_28 {
    pub rbe_left: *mut key_table,
    pub rbe_right: *mut key_table,
    pub rbe_parent: *mut key_table,
    pub rbe_color: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct key_bindings {
    pub rbh_root: *mut key_binding,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct key_binding {
    pub key: key_code,
    pub cmdlist: *mut cmd_list,
    pub note: *const i8,
    pub flags: i32,
    pub entry: C2RustUnnamed_29,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_29 {
    pub rbe_left: *mut key_binding,
    pub rbe_right: *mut key_binding,
    pub rbe_parent: *mut key_binding,
    pub rbe_color: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct cmd_list {
    pub references: i32,
    pub group: u_int,
    pub list: *mut cmds,
}
pub type C2RustUnnamed_30 = u32;
pub const CLIENT_EXIT_DETACH: C2RustUnnamed_30 = 2;
pub const CLIENT_EXIT_SHUTDOWN: C2RustUnnamed_30 = 1;
pub const CLIENT_EXIT_RETURN: C2RustUnnamed_30 = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct status_line {
    pub timer: event,
    pub screen: screen,
    pub active: *mut screen,
    pub references: i32,
    pub style: grid_cell,
    pub entries: [status_line_entry; 5],
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct status_line_entry {
    pub expanded: *mut i8,
    pub ranges: style_ranges,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct style_ranges {
    pub tqh_first: *mut style_range,
    pub tqh_last: *mut *mut style_range,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct style_range {
    pub type_0: style_range_type,
    pub argument: u_int,
    pub string: [i8; 16],
    pub start: u_int,
    pub end: u_int,
    pub entry: C2RustUnnamed_31,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_31 {
    pub tqe_next: *mut style_range,
    pub tqe_prev: *mut *mut style_range,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct tty {
    pub client: *mut client,
    pub start_timer: event,
    pub clipboard_timer: event,
    pub last_requests: time_t,
    pub sx: u_int,
    pub sy: u_int,
    pub xpixel: u_int,
    pub ypixel: u_int,
    pub cx: u_int,
    pub cy: u_int,
    pub cstyle: screen_cursor_style,
    pub ccolour: i32,
    pub oflag: i32,
    pub oox: u_int,
    pub ooy: u_int,
    pub osx: u_int,
    pub osy: u_int,
    pub mode: i32,
    pub fg: i32,
    pub bg: i32,
    pub rlower: u_int,
    pub rupper: u_int,
    pub rleft: u_int,
    pub rright: u_int,
    pub event_in: event,
    pub in_0: *mut evbuffer,
    pub event_out: event,
    pub out: *mut evbuffer,
    pub timer: event,
    pub discarded: size_t,
    pub tio: termios,
    pub cell: grid_cell,
    pub last_cell: grid_cell,
    pub flags: i32,
    pub term: *mut tty_term,
    pub mouse_last_x: u_int,
    pub mouse_last_y: u_int,
    pub mouse_last_b: u_int,
    pub mouse_drag_flag: i32,
    pub mouse_scrolling_flag: i32,
    pub mouse_slider_mpos: i32,
    pub mouse_drag_update: Option<unsafe extern "C" fn(*mut client, *mut mouse_event) -> ()>,
    pub mouse_drag_release: Option<unsafe extern "C" fn(*mut client, *mut mouse_event) -> ()>,
    pub key_timer: event,
    pub key_tree: *mut tty_key,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct tty_term {
    pub name: *mut i8,
    pub tty: *mut tty,
    pub features: i32,
    pub acs: [[i8; 2]; 256],
    pub codes: *mut tty_code,
    pub flags: i32,
    pub entry: C2RustUnnamed_32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_32 {
    pub le_next: *mut tty_term,
    pub le_prev: *mut *mut tty_term,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct client_windows {
    pub rbh_root: *mut client_window,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct client_window {
    pub window: u_int,
    pub pane: *mut window_pane,
    pub sx: u_int,
    pub sy: u_int,
    pub entry: C2RustUnnamed_33,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_33 {
    pub rbe_left: *mut client_window,
    pub rbe_right: *mut client_window,
    pub rbe_parent: *mut client_window,
    pub rbe_color: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct mode_tree_data {
    pub dead: i32,
    pub references: u_int,
    pub zoomed: i32,
    pub wp: *mut window_pane,
    pub modedata: *mut libc::c_void,
    pub menu: *const menu_item,
    pub sort_list: *mut *const i8,
    pub sort_size: u_int,
    pub sort_crit: mode_tree_sort_criteria,
    pub buildcb: mode_tree_build_cb,
    pub drawcb: mode_tree_draw_cb,
    pub searchcb: mode_tree_search_cb,
    pub menucb: mode_tree_menu_cb,
    pub heightcb: mode_tree_height_cb,
    pub keycb: mode_tree_key_cb,
    pub children: mode_tree_list,
    pub saved: mode_tree_list,
    pub line_list: *mut mode_tree_line,
    pub line_size: u_int,
    pub depth: u_int,
    pub width: u_int,
    pub height: u_int,
    pub offset: u_int,
    pub current: u_int,
    pub screen: screen,
    pub preview: i32,
    pub search: *mut i8,
    pub filter: *mut i8,
    pub no_matches: i32,
    pub search_dir: mode_tree_search_dir,
}
pub type mode_tree_search_dir = u32;
pub const MODE_TREE_SEARCH_BACKWARD: mode_tree_search_dir = 1;
pub const MODE_TREE_SEARCH_FORWARD: mode_tree_search_dir = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct mode_tree_line {
    pub item: *mut mode_tree_item,
    pub depth: u_int,
    pub last: i32,
    pub flat: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct mode_tree_item {
    pub parent: *mut mode_tree_item,
    pub itemdata: *mut libc::c_void,
    pub line: u_int,
    pub key: key_code,
    pub keystr: *const i8,
    pub keylen: size_t,
    pub tag: uint64_t,
    pub name: *const i8,
    pub text: *const i8,
    pub expanded: i32,
    pub tagged: i32,
    pub draw_as_parent: i32,
    pub no_tag: i32,
    pub children: mode_tree_list,
    pub entry: C2RustUnnamed_34,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_34 {
    pub tqe_next: *mut mode_tree_item,
    pub tqe_prev: *mut *mut mode_tree_item,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct mode_tree_list {
    pub tqh_first: *mut mode_tree_item,
    pub tqh_last: *mut *mut mode_tree_item,
}
pub type mode_tree_key_cb =
    Option<unsafe extern "C" fn(*mut libc::c_void, *mut libc::c_void, u_int) -> key_code>;
pub type mode_tree_height_cb = Option<unsafe extern "C" fn(*mut libc::c_void, u_int) -> u_int>;
pub type mode_tree_menu_cb =
    Option<unsafe extern "C" fn(*mut libc::c_void, *mut client, key_code) -> ()>;
pub type mode_tree_search_cb = Option<
    unsafe extern "C" fn(*mut libc::c_void, *mut libc::c_void, *const i8) -> i32,
>;
pub type mode_tree_draw_cb = Option<
    unsafe extern "C" fn(
        *mut libc::c_void,
        *mut libc::c_void,
        *mut screen_write_ctx,
        u_int,
        u_int,
    ) -> (),
>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct screen_write_ctx {
    pub wp: *mut window_pane,
    pub s: *mut screen,
    pub flags: i32,
    pub init_ctx_cb: screen_write_init_ctx_cb,
    pub arg: *mut libc::c_void,
    pub item: *mut screen_write_citem,
    pub scrolled: u_int,
    pub bg: u_int,
}
pub type screen_write_init_ctx_cb =
    Option<unsafe extern "C" fn(*mut screen_write_ctx, *mut tty_ctx) -> ()>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct tty_ctx {
    pub s: *mut screen,
    pub redraw_cb: tty_ctx_redraw_cb,
    pub set_client_cb: tty_ctx_set_client_cb,
    pub arg: *mut libc::c_void,
    pub cell: *const grid_cell,
    pub wrapped: i32,
    pub num: u_int,
    pub ptr: *mut libc::c_void,
    pub ptr2: *mut libc::c_void,
    pub allow_invisible_panes: i32,
    pub ocx: u_int,
    pub ocy: u_int,
    pub orupper: u_int,
    pub orlower: u_int,
    pub xoff: u_int,
    pub yoff: u_int,
    pub rxoff: u_int,
    pub ryoff: u_int,
    pub sx: u_int,
    pub sy: u_int,
    pub bg: u_int,
    pub defaults: grid_cell,
    pub palette: *mut colour_palette,
    pub bigger: i32,
    pub wox: u_int,
    pub woy: u_int,
    pub wsx: u_int,
    pub wsy: u_int,
}
pub type tty_ctx_set_client_cb =
    Option<unsafe extern "C" fn(*mut tty_ctx, *mut client) -> i32>;
pub type tty_ctx_redraw_cb = Option<unsafe extern "C" fn(*const tty_ctx) -> ()>;
pub type mode_tree_build_cb = Option<
    unsafe extern "C" fn(
        *mut libc::c_void,
        *mut mode_tree_sort_criteria,
        *mut uint64_t,
        *const i8,
    ) -> (),
>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct mode_tree_sort_criteria {
    pub field: u_int,
    pub reversed: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct menu_item {
    pub name: *const i8,
    pub key: key_code,
    pub command: *const i8,
}
pub type C2RustUnnamed_35 = u32;
pub const KEYC_BASE_END: C2RustUnnamed_35 = 1106562;
pub const KEYC_KP_PERIOD: C2RustUnnamed_35 = 1106561;
pub const KEYC_KP_ZERO: C2RustUnnamed_35 = 1106560;
pub const KEYC_KP_ENTER: C2RustUnnamed_35 = 1106559;
pub const KEYC_KP_THREE: C2RustUnnamed_35 = 1106558;
pub const KEYC_KP_TWO: C2RustUnnamed_35 = 1106557;
pub const KEYC_KP_ONE: C2RustUnnamed_35 = 1106556;
pub const KEYC_KP_SIX: C2RustUnnamed_35 = 1106555;
pub const KEYC_KP_FIVE: C2RustUnnamed_35 = 1106554;
pub const KEYC_KP_FOUR: C2RustUnnamed_35 = 1106553;
pub const KEYC_KP_PLUS: C2RustUnnamed_35 = 1106552;
pub const KEYC_KP_NINE: C2RustUnnamed_35 = 1106551;
pub const KEYC_KP_EIGHT: C2RustUnnamed_35 = 1106550;
pub const KEYC_KP_SEVEN: C2RustUnnamed_35 = 1106549;
pub const KEYC_KP_MINUS: C2RustUnnamed_35 = 1106548;
pub const KEYC_KP_STAR: C2RustUnnamed_35 = 1106547;
pub const KEYC_KP_SLASH: C2RustUnnamed_35 = 1106546;
pub const KEYC_RIGHT: C2RustUnnamed_35 = 1106545;
pub const KEYC_LEFT: C2RustUnnamed_35 = 1106544;
pub const KEYC_DOWN: C2RustUnnamed_35 = 1106543;
pub const KEYC_UP: C2RustUnnamed_35 = 1106542;
pub const KEYC_BTAB: C2RustUnnamed_35 = 1106541;
pub const KEYC_PPAGE: C2RustUnnamed_35 = 1106540;
pub const KEYC_NPAGE: C2RustUnnamed_35 = 1106539;
pub const KEYC_END: C2RustUnnamed_35 = 1106538;
pub const KEYC_HOME: C2RustUnnamed_35 = 1106537;
pub const KEYC_DC: C2RustUnnamed_35 = 1106536;
pub const KEYC_IC: C2RustUnnamed_35 = 1106535;
pub const KEYC_F12: C2RustUnnamed_35 = 1106534;
pub const KEYC_F11: C2RustUnnamed_35 = 1106533;
pub const KEYC_F10: C2RustUnnamed_35 = 1106532;
pub const KEYC_F9: C2RustUnnamed_35 = 1106531;
pub const KEYC_F8: C2RustUnnamed_35 = 1106530;
pub const KEYC_F7: C2RustUnnamed_35 = 1106529;
pub const KEYC_F6: C2RustUnnamed_35 = 1106528;
pub const KEYC_F5: C2RustUnnamed_35 = 1106527;
pub const KEYC_F4: C2RustUnnamed_35 = 1106526;
pub const KEYC_F3: C2RustUnnamed_35 = 1106525;
pub const KEYC_F2: C2RustUnnamed_35 = 1106524;
pub const KEYC_F1: C2RustUnnamed_35 = 1106523;
pub const KEYC_BSPACE: C2RustUnnamed_35 = 1106522;
pub const KEYC_TRIPLECLICK11_BORDER: C2RustUnnamed_35 = 1106521;
pub const KEYC_TRIPLECLICK11_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106520;
pub const KEYC_TRIPLECLICK11_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106519;
pub const KEYC_TRIPLECLICK11_SCROLLBAR_UP: C2RustUnnamed_35 = 1106518;
pub const KEYC_TRIPLECLICK11_STATUS_DEFAULT: C2RustUnnamed_35 = 1106517;
pub const KEYC_TRIPLECLICK11_STATUS_RIGHT: C2RustUnnamed_35 = 1106516;
pub const KEYC_TRIPLECLICK11_STATUS_LEFT: C2RustUnnamed_35 = 1106515;
pub const KEYC_TRIPLECLICK11_STATUS: C2RustUnnamed_35 = 1106514;
pub const KEYC_TRIPLECLICK11_PANE: C2RustUnnamed_35 = 1106513;
pub const KEYC_TRIPLECLICK10_BORDER: C2RustUnnamed_35 = 1106512;
pub const KEYC_TRIPLECLICK10_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106511;
pub const KEYC_TRIPLECLICK10_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106510;
pub const KEYC_TRIPLECLICK10_SCROLLBAR_UP: C2RustUnnamed_35 = 1106509;
pub const KEYC_TRIPLECLICK10_STATUS_DEFAULT: C2RustUnnamed_35 = 1106508;
pub const KEYC_TRIPLECLICK10_STATUS_RIGHT: C2RustUnnamed_35 = 1106507;
pub const KEYC_TRIPLECLICK10_STATUS_LEFT: C2RustUnnamed_35 = 1106506;
pub const KEYC_TRIPLECLICK10_STATUS: C2RustUnnamed_35 = 1106505;
pub const KEYC_TRIPLECLICK10_PANE: C2RustUnnamed_35 = 1106504;
pub const KEYC_TRIPLECLICK9_BORDER: C2RustUnnamed_35 = 1106503;
pub const KEYC_TRIPLECLICK9_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106502;
pub const KEYC_TRIPLECLICK9_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106501;
pub const KEYC_TRIPLECLICK9_SCROLLBAR_UP: C2RustUnnamed_35 = 1106500;
pub const KEYC_TRIPLECLICK9_STATUS_DEFAULT: C2RustUnnamed_35 = 1106499;
pub const KEYC_TRIPLECLICK9_STATUS_RIGHT: C2RustUnnamed_35 = 1106498;
pub const KEYC_TRIPLECLICK9_STATUS_LEFT: C2RustUnnamed_35 = 1106497;
pub const KEYC_TRIPLECLICK9_STATUS: C2RustUnnamed_35 = 1106496;
pub const KEYC_TRIPLECLICK9_PANE: C2RustUnnamed_35 = 1106495;
pub const KEYC_TRIPLECLICK8_BORDER: C2RustUnnamed_35 = 1106494;
pub const KEYC_TRIPLECLICK8_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106493;
pub const KEYC_TRIPLECLICK8_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106492;
pub const KEYC_TRIPLECLICK8_SCROLLBAR_UP: C2RustUnnamed_35 = 1106491;
pub const KEYC_TRIPLECLICK8_STATUS_DEFAULT: C2RustUnnamed_35 = 1106490;
pub const KEYC_TRIPLECLICK8_STATUS_RIGHT: C2RustUnnamed_35 = 1106489;
pub const KEYC_TRIPLECLICK8_STATUS_LEFT: C2RustUnnamed_35 = 1106488;
pub const KEYC_TRIPLECLICK8_STATUS: C2RustUnnamed_35 = 1106487;
pub const KEYC_TRIPLECLICK8_PANE: C2RustUnnamed_35 = 1106486;
pub const KEYC_TRIPLECLICK7_BORDER: C2RustUnnamed_35 = 1106485;
pub const KEYC_TRIPLECLICK7_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106484;
pub const KEYC_TRIPLECLICK7_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106483;
pub const KEYC_TRIPLECLICK7_SCROLLBAR_UP: C2RustUnnamed_35 = 1106482;
pub const KEYC_TRIPLECLICK7_STATUS_DEFAULT: C2RustUnnamed_35 = 1106481;
pub const KEYC_TRIPLECLICK7_STATUS_RIGHT: C2RustUnnamed_35 = 1106480;
pub const KEYC_TRIPLECLICK7_STATUS_LEFT: C2RustUnnamed_35 = 1106479;
pub const KEYC_TRIPLECLICK7_STATUS: C2RustUnnamed_35 = 1106478;
pub const KEYC_TRIPLECLICK7_PANE: C2RustUnnamed_35 = 1106477;
pub const KEYC_TRIPLECLICK6_BORDER: C2RustUnnamed_35 = 1106476;
pub const KEYC_TRIPLECLICK6_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106475;
pub const KEYC_TRIPLECLICK6_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106474;
pub const KEYC_TRIPLECLICK6_SCROLLBAR_UP: C2RustUnnamed_35 = 1106473;
pub const KEYC_TRIPLECLICK6_STATUS_DEFAULT: C2RustUnnamed_35 = 1106472;
pub const KEYC_TRIPLECLICK6_STATUS_RIGHT: C2RustUnnamed_35 = 1106471;
pub const KEYC_TRIPLECLICK6_STATUS_LEFT: C2RustUnnamed_35 = 1106470;
pub const KEYC_TRIPLECLICK6_STATUS: C2RustUnnamed_35 = 1106469;
pub const KEYC_TRIPLECLICK6_PANE: C2RustUnnamed_35 = 1106468;
pub const KEYC_TRIPLECLICK3_BORDER: C2RustUnnamed_35 = 1106467;
pub const KEYC_TRIPLECLICK3_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106466;
pub const KEYC_TRIPLECLICK3_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106465;
pub const KEYC_TRIPLECLICK3_SCROLLBAR_UP: C2RustUnnamed_35 = 1106464;
pub const KEYC_TRIPLECLICK3_STATUS_DEFAULT: C2RustUnnamed_35 = 1106463;
pub const KEYC_TRIPLECLICK3_STATUS_RIGHT: C2RustUnnamed_35 = 1106462;
pub const KEYC_TRIPLECLICK3_STATUS_LEFT: C2RustUnnamed_35 = 1106461;
pub const KEYC_TRIPLECLICK3_STATUS: C2RustUnnamed_35 = 1106460;
pub const KEYC_TRIPLECLICK3_PANE: C2RustUnnamed_35 = 1106459;
pub const KEYC_TRIPLECLICK2_BORDER: C2RustUnnamed_35 = 1106458;
pub const KEYC_TRIPLECLICK2_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106457;
pub const KEYC_TRIPLECLICK2_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106456;
pub const KEYC_TRIPLECLICK2_SCROLLBAR_UP: C2RustUnnamed_35 = 1106455;
pub const KEYC_TRIPLECLICK2_STATUS_DEFAULT: C2RustUnnamed_35 = 1106454;
pub const KEYC_TRIPLECLICK2_STATUS_RIGHT: C2RustUnnamed_35 = 1106453;
pub const KEYC_TRIPLECLICK2_STATUS_LEFT: C2RustUnnamed_35 = 1106452;
pub const KEYC_TRIPLECLICK2_STATUS: C2RustUnnamed_35 = 1106451;
pub const KEYC_TRIPLECLICK2_PANE: C2RustUnnamed_35 = 1106450;
pub const KEYC_TRIPLECLICK1_BORDER: C2RustUnnamed_35 = 1106449;
pub const KEYC_TRIPLECLICK1_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106448;
pub const KEYC_TRIPLECLICK1_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106447;
pub const KEYC_TRIPLECLICK1_SCROLLBAR_UP: C2RustUnnamed_35 = 1106446;
pub const KEYC_TRIPLECLICK1_STATUS_DEFAULT: C2RustUnnamed_35 = 1106445;
pub const KEYC_TRIPLECLICK1_STATUS_RIGHT: C2RustUnnamed_35 = 1106444;
pub const KEYC_TRIPLECLICK1_STATUS_LEFT: C2RustUnnamed_35 = 1106443;
pub const KEYC_TRIPLECLICK1_STATUS: C2RustUnnamed_35 = 1106442;
pub const KEYC_TRIPLECLICK1_PANE: C2RustUnnamed_35 = 1106441;
pub const KEYC_DOUBLECLICK11_BORDER: C2RustUnnamed_35 = 1106440;
pub const KEYC_DOUBLECLICK11_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106439;
pub const KEYC_DOUBLECLICK11_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106438;
pub const KEYC_DOUBLECLICK11_SCROLLBAR_UP: C2RustUnnamed_35 = 1106437;
pub const KEYC_DOUBLECLICK11_STATUS_DEFAULT: C2RustUnnamed_35 = 1106436;
pub const KEYC_DOUBLECLICK11_STATUS_RIGHT: C2RustUnnamed_35 = 1106435;
pub const KEYC_DOUBLECLICK11_STATUS_LEFT: C2RustUnnamed_35 = 1106434;
pub const KEYC_DOUBLECLICK11_STATUS: C2RustUnnamed_35 = 1106433;
pub const KEYC_DOUBLECLICK11_PANE: C2RustUnnamed_35 = 1106432;
pub const KEYC_DOUBLECLICK10_BORDER: C2RustUnnamed_35 = 1106431;
pub const KEYC_DOUBLECLICK10_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106430;
pub const KEYC_DOUBLECLICK10_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106429;
pub const KEYC_DOUBLECLICK10_SCROLLBAR_UP: C2RustUnnamed_35 = 1106428;
pub const KEYC_DOUBLECLICK10_STATUS_DEFAULT: C2RustUnnamed_35 = 1106427;
pub const KEYC_DOUBLECLICK10_STATUS_RIGHT: C2RustUnnamed_35 = 1106426;
pub const KEYC_DOUBLECLICK10_STATUS_LEFT: C2RustUnnamed_35 = 1106425;
pub const KEYC_DOUBLECLICK10_STATUS: C2RustUnnamed_35 = 1106424;
pub const KEYC_DOUBLECLICK10_PANE: C2RustUnnamed_35 = 1106423;
pub const KEYC_DOUBLECLICK9_BORDER: C2RustUnnamed_35 = 1106422;
pub const KEYC_DOUBLECLICK9_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106421;
pub const KEYC_DOUBLECLICK9_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106420;
pub const KEYC_DOUBLECLICK9_SCROLLBAR_UP: C2RustUnnamed_35 = 1106419;
pub const KEYC_DOUBLECLICK9_STATUS_DEFAULT: C2RustUnnamed_35 = 1106418;
pub const KEYC_DOUBLECLICK9_STATUS_RIGHT: C2RustUnnamed_35 = 1106417;
pub const KEYC_DOUBLECLICK9_STATUS_LEFT: C2RustUnnamed_35 = 1106416;
pub const KEYC_DOUBLECLICK9_STATUS: C2RustUnnamed_35 = 1106415;
pub const KEYC_DOUBLECLICK9_PANE: C2RustUnnamed_35 = 1106414;
pub const KEYC_DOUBLECLICK8_BORDER: C2RustUnnamed_35 = 1106413;
pub const KEYC_DOUBLECLICK8_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106412;
pub const KEYC_DOUBLECLICK8_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106411;
pub const KEYC_DOUBLECLICK8_SCROLLBAR_UP: C2RustUnnamed_35 = 1106410;
pub const KEYC_DOUBLECLICK8_STATUS_DEFAULT: C2RustUnnamed_35 = 1106409;
pub const KEYC_DOUBLECLICK8_STATUS_RIGHT: C2RustUnnamed_35 = 1106408;
pub const KEYC_DOUBLECLICK8_STATUS_LEFT: C2RustUnnamed_35 = 1106407;
pub const KEYC_DOUBLECLICK8_STATUS: C2RustUnnamed_35 = 1106406;
pub const KEYC_DOUBLECLICK8_PANE: C2RustUnnamed_35 = 1106405;
pub const KEYC_DOUBLECLICK7_BORDER: C2RustUnnamed_35 = 1106404;
pub const KEYC_DOUBLECLICK7_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106403;
pub const KEYC_DOUBLECLICK7_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106402;
pub const KEYC_DOUBLECLICK7_SCROLLBAR_UP: C2RustUnnamed_35 = 1106401;
pub const KEYC_DOUBLECLICK7_STATUS_DEFAULT: C2RustUnnamed_35 = 1106400;
pub const KEYC_DOUBLECLICK7_STATUS_RIGHT: C2RustUnnamed_35 = 1106399;
pub const KEYC_DOUBLECLICK7_STATUS_LEFT: C2RustUnnamed_35 = 1106398;
pub const KEYC_DOUBLECLICK7_STATUS: C2RustUnnamed_35 = 1106397;
pub const KEYC_DOUBLECLICK7_PANE: C2RustUnnamed_35 = 1106396;
pub const KEYC_DOUBLECLICK6_BORDER: C2RustUnnamed_35 = 1106395;
pub const KEYC_DOUBLECLICK6_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106394;
pub const KEYC_DOUBLECLICK6_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106393;
pub const KEYC_DOUBLECLICK6_SCROLLBAR_UP: C2RustUnnamed_35 = 1106392;
pub const KEYC_DOUBLECLICK6_STATUS_DEFAULT: C2RustUnnamed_35 = 1106391;
pub const KEYC_DOUBLECLICK6_STATUS_RIGHT: C2RustUnnamed_35 = 1106390;
pub const KEYC_DOUBLECLICK6_STATUS_LEFT: C2RustUnnamed_35 = 1106389;
pub const KEYC_DOUBLECLICK6_STATUS: C2RustUnnamed_35 = 1106388;
pub const KEYC_DOUBLECLICK6_PANE: C2RustUnnamed_35 = 1106387;
pub const KEYC_DOUBLECLICK3_BORDER: C2RustUnnamed_35 = 1106386;
pub const KEYC_DOUBLECLICK3_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106385;
pub const KEYC_DOUBLECLICK3_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106384;
pub const KEYC_DOUBLECLICK3_SCROLLBAR_UP: C2RustUnnamed_35 = 1106383;
pub const KEYC_DOUBLECLICK3_STATUS_DEFAULT: C2RustUnnamed_35 = 1106382;
pub const KEYC_DOUBLECLICK3_STATUS_RIGHT: C2RustUnnamed_35 = 1106381;
pub const KEYC_DOUBLECLICK3_STATUS_LEFT: C2RustUnnamed_35 = 1106380;
pub const KEYC_DOUBLECLICK3_STATUS: C2RustUnnamed_35 = 1106379;
pub const KEYC_DOUBLECLICK3_PANE: C2RustUnnamed_35 = 1106378;
pub const KEYC_DOUBLECLICK2_BORDER: C2RustUnnamed_35 = 1106377;
pub const KEYC_DOUBLECLICK2_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106376;
pub const KEYC_DOUBLECLICK2_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106375;
pub const KEYC_DOUBLECLICK2_SCROLLBAR_UP: C2RustUnnamed_35 = 1106374;
pub const KEYC_DOUBLECLICK2_STATUS_DEFAULT: C2RustUnnamed_35 = 1106373;
pub const KEYC_DOUBLECLICK2_STATUS_RIGHT: C2RustUnnamed_35 = 1106372;
pub const KEYC_DOUBLECLICK2_STATUS_LEFT: C2RustUnnamed_35 = 1106371;
pub const KEYC_DOUBLECLICK2_STATUS: C2RustUnnamed_35 = 1106370;
pub const KEYC_DOUBLECLICK2_PANE: C2RustUnnamed_35 = 1106369;
pub const KEYC_DOUBLECLICK1_BORDER: C2RustUnnamed_35 = 1106368;
pub const KEYC_DOUBLECLICK1_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106367;
pub const KEYC_DOUBLECLICK1_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106366;
pub const KEYC_DOUBLECLICK1_SCROLLBAR_UP: C2RustUnnamed_35 = 1106365;
pub const KEYC_DOUBLECLICK1_STATUS_DEFAULT: C2RustUnnamed_35 = 1106364;
pub const KEYC_DOUBLECLICK1_STATUS_RIGHT: C2RustUnnamed_35 = 1106363;
pub const KEYC_DOUBLECLICK1_STATUS_LEFT: C2RustUnnamed_35 = 1106362;
pub const KEYC_DOUBLECLICK1_STATUS: C2RustUnnamed_35 = 1106361;
pub const KEYC_DOUBLECLICK1_PANE: C2RustUnnamed_35 = 1106360;
pub const KEYC_SECONDCLICK11_BORDER: C2RustUnnamed_35 = 1106359;
pub const KEYC_SECONDCLICK11_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106358;
pub const KEYC_SECONDCLICK11_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106357;
pub const KEYC_SECONDCLICK11_SCROLLBAR_UP: C2RustUnnamed_35 = 1106356;
pub const KEYC_SECONDCLICK11_STATUS_DEFAULT: C2RustUnnamed_35 = 1106355;
pub const KEYC_SECONDCLICK11_STATUS_RIGHT: C2RustUnnamed_35 = 1106354;
pub const KEYC_SECONDCLICK11_STATUS_LEFT: C2RustUnnamed_35 = 1106353;
pub const KEYC_SECONDCLICK11_STATUS: C2RustUnnamed_35 = 1106352;
pub const KEYC_SECONDCLICK11_PANE: C2RustUnnamed_35 = 1106351;
pub const KEYC_SECONDCLICK10_BORDER: C2RustUnnamed_35 = 1106350;
pub const KEYC_SECONDCLICK10_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106349;
pub const KEYC_SECONDCLICK10_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106348;
pub const KEYC_SECONDCLICK10_SCROLLBAR_UP: C2RustUnnamed_35 = 1106347;
pub const KEYC_SECONDCLICK10_STATUS_DEFAULT: C2RustUnnamed_35 = 1106346;
pub const KEYC_SECONDCLICK10_STATUS_RIGHT: C2RustUnnamed_35 = 1106345;
pub const KEYC_SECONDCLICK10_STATUS_LEFT: C2RustUnnamed_35 = 1106344;
pub const KEYC_SECONDCLICK10_STATUS: C2RustUnnamed_35 = 1106343;
pub const KEYC_SECONDCLICK10_PANE: C2RustUnnamed_35 = 1106342;
pub const KEYC_SECONDCLICK9_BORDER: C2RustUnnamed_35 = 1106341;
pub const KEYC_SECONDCLICK9_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106340;
pub const KEYC_SECONDCLICK9_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106339;
pub const KEYC_SECONDCLICK9_SCROLLBAR_UP: C2RustUnnamed_35 = 1106338;
pub const KEYC_SECONDCLICK9_STATUS_DEFAULT: C2RustUnnamed_35 = 1106337;
pub const KEYC_SECONDCLICK9_STATUS_RIGHT: C2RustUnnamed_35 = 1106336;
pub const KEYC_SECONDCLICK9_STATUS_LEFT: C2RustUnnamed_35 = 1106335;
pub const KEYC_SECONDCLICK9_STATUS: C2RustUnnamed_35 = 1106334;
pub const KEYC_SECONDCLICK9_PANE: C2RustUnnamed_35 = 1106333;
pub const KEYC_SECONDCLICK8_BORDER: C2RustUnnamed_35 = 1106332;
pub const KEYC_SECONDCLICK8_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106331;
pub const KEYC_SECONDCLICK8_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106330;
pub const KEYC_SECONDCLICK8_SCROLLBAR_UP: C2RustUnnamed_35 = 1106329;
pub const KEYC_SECONDCLICK8_STATUS_DEFAULT: C2RustUnnamed_35 = 1106328;
pub const KEYC_SECONDCLICK8_STATUS_RIGHT: C2RustUnnamed_35 = 1106327;
pub const KEYC_SECONDCLICK8_STATUS_LEFT: C2RustUnnamed_35 = 1106326;
pub const KEYC_SECONDCLICK8_STATUS: C2RustUnnamed_35 = 1106325;
pub const KEYC_SECONDCLICK8_PANE: C2RustUnnamed_35 = 1106324;
pub const KEYC_SECONDCLICK7_BORDER: C2RustUnnamed_35 = 1106323;
pub const KEYC_SECONDCLICK7_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106322;
pub const KEYC_SECONDCLICK7_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106321;
pub const KEYC_SECONDCLICK7_SCROLLBAR_UP: C2RustUnnamed_35 = 1106320;
pub const KEYC_SECONDCLICK7_STATUS_DEFAULT: C2RustUnnamed_35 = 1106319;
pub const KEYC_SECONDCLICK7_STATUS_RIGHT: C2RustUnnamed_35 = 1106318;
pub const KEYC_SECONDCLICK7_STATUS_LEFT: C2RustUnnamed_35 = 1106317;
pub const KEYC_SECONDCLICK7_STATUS: C2RustUnnamed_35 = 1106316;
pub const KEYC_SECONDCLICK7_PANE: C2RustUnnamed_35 = 1106315;
pub const KEYC_SECONDCLICK6_BORDER: C2RustUnnamed_35 = 1106314;
pub const KEYC_SECONDCLICK6_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106313;
pub const KEYC_SECONDCLICK6_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106312;
pub const KEYC_SECONDCLICK6_SCROLLBAR_UP: C2RustUnnamed_35 = 1106311;
pub const KEYC_SECONDCLICK6_STATUS_DEFAULT: C2RustUnnamed_35 = 1106310;
pub const KEYC_SECONDCLICK6_STATUS_RIGHT: C2RustUnnamed_35 = 1106309;
pub const KEYC_SECONDCLICK6_STATUS_LEFT: C2RustUnnamed_35 = 1106308;
pub const KEYC_SECONDCLICK6_STATUS: C2RustUnnamed_35 = 1106307;
pub const KEYC_SECONDCLICK6_PANE: C2RustUnnamed_35 = 1106306;
pub const KEYC_SECONDCLICK3_BORDER: C2RustUnnamed_35 = 1106305;
pub const KEYC_SECONDCLICK3_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106304;
pub const KEYC_SECONDCLICK3_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106303;
pub const KEYC_SECONDCLICK3_SCROLLBAR_UP: C2RustUnnamed_35 = 1106302;
pub const KEYC_SECONDCLICK3_STATUS_DEFAULT: C2RustUnnamed_35 = 1106301;
pub const KEYC_SECONDCLICK3_STATUS_RIGHT: C2RustUnnamed_35 = 1106300;
pub const KEYC_SECONDCLICK3_STATUS_LEFT: C2RustUnnamed_35 = 1106299;
pub const KEYC_SECONDCLICK3_STATUS: C2RustUnnamed_35 = 1106298;
pub const KEYC_SECONDCLICK3_PANE: C2RustUnnamed_35 = 1106297;
pub const KEYC_SECONDCLICK2_BORDER: C2RustUnnamed_35 = 1106296;
pub const KEYC_SECONDCLICK2_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106295;
pub const KEYC_SECONDCLICK2_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106294;
pub const KEYC_SECONDCLICK2_SCROLLBAR_UP: C2RustUnnamed_35 = 1106293;
pub const KEYC_SECONDCLICK2_STATUS_DEFAULT: C2RustUnnamed_35 = 1106292;
pub const KEYC_SECONDCLICK2_STATUS_RIGHT: C2RustUnnamed_35 = 1106291;
pub const KEYC_SECONDCLICK2_STATUS_LEFT: C2RustUnnamed_35 = 1106290;
pub const KEYC_SECONDCLICK2_STATUS: C2RustUnnamed_35 = 1106289;
pub const KEYC_SECONDCLICK2_PANE: C2RustUnnamed_35 = 1106288;
pub const KEYC_SECONDCLICK1_BORDER: C2RustUnnamed_35 = 1106287;
pub const KEYC_SECONDCLICK1_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106286;
pub const KEYC_SECONDCLICK1_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106285;
pub const KEYC_SECONDCLICK1_SCROLLBAR_UP: C2RustUnnamed_35 = 1106284;
pub const KEYC_SECONDCLICK1_STATUS_DEFAULT: C2RustUnnamed_35 = 1106283;
pub const KEYC_SECONDCLICK1_STATUS_RIGHT: C2RustUnnamed_35 = 1106282;
pub const KEYC_SECONDCLICK1_STATUS_LEFT: C2RustUnnamed_35 = 1106281;
pub const KEYC_SECONDCLICK1_STATUS: C2RustUnnamed_35 = 1106280;
pub const KEYC_SECONDCLICK1_PANE: C2RustUnnamed_35 = 1106279;
pub const KEYC_WHEELDOWN_BORDER: C2RustUnnamed_35 = 1106278;
pub const KEYC_WHEELDOWN_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106277;
pub const KEYC_WHEELDOWN_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106276;
pub const KEYC_WHEELDOWN_SCROLLBAR_UP: C2RustUnnamed_35 = 1106275;
pub const KEYC_WHEELDOWN_STATUS_DEFAULT: C2RustUnnamed_35 = 1106274;
pub const KEYC_WHEELDOWN_STATUS_RIGHT: C2RustUnnamed_35 = 1106273;
pub const KEYC_WHEELDOWN_STATUS_LEFT: C2RustUnnamed_35 = 1106272;
pub const KEYC_WHEELDOWN_STATUS: C2RustUnnamed_35 = 1106271;
pub const KEYC_WHEELDOWN_PANE: C2RustUnnamed_35 = 1106270;
pub const KEYC_WHEELUP_BORDER: C2RustUnnamed_35 = 1106269;
pub const KEYC_WHEELUP_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106268;
pub const KEYC_WHEELUP_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106267;
pub const KEYC_WHEELUP_SCROLLBAR_UP: C2RustUnnamed_35 = 1106266;
pub const KEYC_WHEELUP_STATUS_DEFAULT: C2RustUnnamed_35 = 1106265;
pub const KEYC_WHEELUP_STATUS_RIGHT: C2RustUnnamed_35 = 1106264;
pub const KEYC_WHEELUP_STATUS_LEFT: C2RustUnnamed_35 = 1106263;
pub const KEYC_WHEELUP_STATUS: C2RustUnnamed_35 = 1106262;
pub const KEYC_WHEELUP_PANE: C2RustUnnamed_35 = 1106261;
pub const KEYC_MOUSEDRAGEND11_BORDER: C2RustUnnamed_35 = 1106260;
pub const KEYC_MOUSEDRAGEND11_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106259;
pub const KEYC_MOUSEDRAGEND11_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106258;
pub const KEYC_MOUSEDRAGEND11_SCROLLBAR_UP: C2RustUnnamed_35 = 1106257;
pub const KEYC_MOUSEDRAGEND11_STATUS_DEFAULT: C2RustUnnamed_35 = 1106256;
pub const KEYC_MOUSEDRAGEND11_STATUS_RIGHT: C2RustUnnamed_35 = 1106255;
pub const KEYC_MOUSEDRAGEND11_STATUS_LEFT: C2RustUnnamed_35 = 1106254;
pub const KEYC_MOUSEDRAGEND11_STATUS: C2RustUnnamed_35 = 1106253;
pub const KEYC_MOUSEDRAGEND11_PANE: C2RustUnnamed_35 = 1106252;
pub const KEYC_MOUSEDRAGEND10_BORDER: C2RustUnnamed_35 = 1106251;
pub const KEYC_MOUSEDRAGEND10_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106250;
pub const KEYC_MOUSEDRAGEND10_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106249;
pub const KEYC_MOUSEDRAGEND10_SCROLLBAR_UP: C2RustUnnamed_35 = 1106248;
pub const KEYC_MOUSEDRAGEND10_STATUS_DEFAULT: C2RustUnnamed_35 = 1106247;
pub const KEYC_MOUSEDRAGEND10_STATUS_RIGHT: C2RustUnnamed_35 = 1106246;
pub const KEYC_MOUSEDRAGEND10_STATUS_LEFT: C2RustUnnamed_35 = 1106245;
pub const KEYC_MOUSEDRAGEND10_STATUS: C2RustUnnamed_35 = 1106244;
pub const KEYC_MOUSEDRAGEND10_PANE: C2RustUnnamed_35 = 1106243;
pub const KEYC_MOUSEDRAGEND9_BORDER: C2RustUnnamed_35 = 1106242;
pub const KEYC_MOUSEDRAGEND9_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106241;
pub const KEYC_MOUSEDRAGEND9_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106240;
pub const KEYC_MOUSEDRAGEND9_SCROLLBAR_UP: C2RustUnnamed_35 = 1106239;
pub const KEYC_MOUSEDRAGEND9_STATUS_DEFAULT: C2RustUnnamed_35 = 1106238;
pub const KEYC_MOUSEDRAGEND9_STATUS_RIGHT: C2RustUnnamed_35 = 1106237;
pub const KEYC_MOUSEDRAGEND9_STATUS_LEFT: C2RustUnnamed_35 = 1106236;
pub const KEYC_MOUSEDRAGEND9_STATUS: C2RustUnnamed_35 = 1106235;
pub const KEYC_MOUSEDRAGEND9_PANE: C2RustUnnamed_35 = 1106234;
pub const KEYC_MOUSEDRAGEND8_BORDER: C2RustUnnamed_35 = 1106233;
pub const KEYC_MOUSEDRAGEND8_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106232;
pub const KEYC_MOUSEDRAGEND8_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106231;
pub const KEYC_MOUSEDRAGEND8_SCROLLBAR_UP: C2RustUnnamed_35 = 1106230;
pub const KEYC_MOUSEDRAGEND8_STATUS_DEFAULT: C2RustUnnamed_35 = 1106229;
pub const KEYC_MOUSEDRAGEND8_STATUS_RIGHT: C2RustUnnamed_35 = 1106228;
pub const KEYC_MOUSEDRAGEND8_STATUS_LEFT: C2RustUnnamed_35 = 1106227;
pub const KEYC_MOUSEDRAGEND8_STATUS: C2RustUnnamed_35 = 1106226;
pub const KEYC_MOUSEDRAGEND8_PANE: C2RustUnnamed_35 = 1106225;
pub const KEYC_MOUSEDRAGEND7_BORDER: C2RustUnnamed_35 = 1106224;
pub const KEYC_MOUSEDRAGEND7_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106223;
pub const KEYC_MOUSEDRAGEND7_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106222;
pub const KEYC_MOUSEDRAGEND7_SCROLLBAR_UP: C2RustUnnamed_35 = 1106221;
pub const KEYC_MOUSEDRAGEND7_STATUS_DEFAULT: C2RustUnnamed_35 = 1106220;
pub const KEYC_MOUSEDRAGEND7_STATUS_RIGHT: C2RustUnnamed_35 = 1106219;
pub const KEYC_MOUSEDRAGEND7_STATUS_LEFT: C2RustUnnamed_35 = 1106218;
pub const KEYC_MOUSEDRAGEND7_STATUS: C2RustUnnamed_35 = 1106217;
pub const KEYC_MOUSEDRAGEND7_PANE: C2RustUnnamed_35 = 1106216;
pub const KEYC_MOUSEDRAGEND6_BORDER: C2RustUnnamed_35 = 1106215;
pub const KEYC_MOUSEDRAGEND6_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106214;
pub const KEYC_MOUSEDRAGEND6_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106213;
pub const KEYC_MOUSEDRAGEND6_SCROLLBAR_UP: C2RustUnnamed_35 = 1106212;
pub const KEYC_MOUSEDRAGEND6_STATUS_DEFAULT: C2RustUnnamed_35 = 1106211;
pub const KEYC_MOUSEDRAGEND6_STATUS_RIGHT: C2RustUnnamed_35 = 1106210;
pub const KEYC_MOUSEDRAGEND6_STATUS_LEFT: C2RustUnnamed_35 = 1106209;
pub const KEYC_MOUSEDRAGEND6_STATUS: C2RustUnnamed_35 = 1106208;
pub const KEYC_MOUSEDRAGEND6_PANE: C2RustUnnamed_35 = 1106207;
pub const KEYC_MOUSEDRAGEND3_BORDER: C2RustUnnamed_35 = 1106206;
pub const KEYC_MOUSEDRAGEND3_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106205;
pub const KEYC_MOUSEDRAGEND3_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106204;
pub const KEYC_MOUSEDRAGEND3_SCROLLBAR_UP: C2RustUnnamed_35 = 1106203;
pub const KEYC_MOUSEDRAGEND3_STATUS_DEFAULT: C2RustUnnamed_35 = 1106202;
pub const KEYC_MOUSEDRAGEND3_STATUS_RIGHT: C2RustUnnamed_35 = 1106201;
pub const KEYC_MOUSEDRAGEND3_STATUS_LEFT: C2RustUnnamed_35 = 1106200;
pub const KEYC_MOUSEDRAGEND3_STATUS: C2RustUnnamed_35 = 1106199;
pub const KEYC_MOUSEDRAGEND3_PANE: C2RustUnnamed_35 = 1106198;
pub const KEYC_MOUSEDRAGEND2_BORDER: C2RustUnnamed_35 = 1106197;
pub const KEYC_MOUSEDRAGEND2_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106196;
pub const KEYC_MOUSEDRAGEND2_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106195;
pub const KEYC_MOUSEDRAGEND2_SCROLLBAR_UP: C2RustUnnamed_35 = 1106194;
pub const KEYC_MOUSEDRAGEND2_STATUS_DEFAULT: C2RustUnnamed_35 = 1106193;
pub const KEYC_MOUSEDRAGEND2_STATUS_RIGHT: C2RustUnnamed_35 = 1106192;
pub const KEYC_MOUSEDRAGEND2_STATUS_LEFT: C2RustUnnamed_35 = 1106191;
pub const KEYC_MOUSEDRAGEND2_STATUS: C2RustUnnamed_35 = 1106190;
pub const KEYC_MOUSEDRAGEND2_PANE: C2RustUnnamed_35 = 1106189;
pub const KEYC_MOUSEDRAGEND1_BORDER: C2RustUnnamed_35 = 1106188;
pub const KEYC_MOUSEDRAGEND1_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106187;
pub const KEYC_MOUSEDRAGEND1_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106186;
pub const KEYC_MOUSEDRAGEND1_SCROLLBAR_UP: C2RustUnnamed_35 = 1106185;
pub const KEYC_MOUSEDRAGEND1_STATUS_DEFAULT: C2RustUnnamed_35 = 1106184;
pub const KEYC_MOUSEDRAGEND1_STATUS_RIGHT: C2RustUnnamed_35 = 1106183;
pub const KEYC_MOUSEDRAGEND1_STATUS_LEFT: C2RustUnnamed_35 = 1106182;
pub const KEYC_MOUSEDRAGEND1_STATUS: C2RustUnnamed_35 = 1106181;
pub const KEYC_MOUSEDRAGEND1_PANE: C2RustUnnamed_35 = 1106180;
pub const KEYC_MOUSEDRAG11_BORDER: C2RustUnnamed_35 = 1106179;
pub const KEYC_MOUSEDRAG11_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106178;
pub const KEYC_MOUSEDRAG11_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106177;
pub const KEYC_MOUSEDRAG11_SCROLLBAR_UP: C2RustUnnamed_35 = 1106176;
pub const KEYC_MOUSEDRAG11_STATUS_DEFAULT: C2RustUnnamed_35 = 1106175;
pub const KEYC_MOUSEDRAG11_STATUS_RIGHT: C2RustUnnamed_35 = 1106174;
pub const KEYC_MOUSEDRAG11_STATUS_LEFT: C2RustUnnamed_35 = 1106173;
pub const KEYC_MOUSEDRAG11_STATUS: C2RustUnnamed_35 = 1106172;
pub const KEYC_MOUSEDRAG11_PANE: C2RustUnnamed_35 = 1106171;
pub const KEYC_MOUSEDRAG10_BORDER: C2RustUnnamed_35 = 1106170;
pub const KEYC_MOUSEDRAG10_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106169;
pub const KEYC_MOUSEDRAG10_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106168;
pub const KEYC_MOUSEDRAG10_SCROLLBAR_UP: C2RustUnnamed_35 = 1106167;
pub const KEYC_MOUSEDRAG10_STATUS_DEFAULT: C2RustUnnamed_35 = 1106166;
pub const KEYC_MOUSEDRAG10_STATUS_RIGHT: C2RustUnnamed_35 = 1106165;
pub const KEYC_MOUSEDRAG10_STATUS_LEFT: C2RustUnnamed_35 = 1106164;
pub const KEYC_MOUSEDRAG10_STATUS: C2RustUnnamed_35 = 1106163;
pub const KEYC_MOUSEDRAG10_PANE: C2RustUnnamed_35 = 1106162;
pub const KEYC_MOUSEDRAG9_BORDER: C2RustUnnamed_35 = 1106161;
pub const KEYC_MOUSEDRAG9_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106160;
pub const KEYC_MOUSEDRAG9_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106159;
pub const KEYC_MOUSEDRAG9_SCROLLBAR_UP: C2RustUnnamed_35 = 1106158;
pub const KEYC_MOUSEDRAG9_STATUS_DEFAULT: C2RustUnnamed_35 = 1106157;
pub const KEYC_MOUSEDRAG9_STATUS_RIGHT: C2RustUnnamed_35 = 1106156;
pub const KEYC_MOUSEDRAG9_STATUS_LEFT: C2RustUnnamed_35 = 1106155;
pub const KEYC_MOUSEDRAG9_STATUS: C2RustUnnamed_35 = 1106154;
pub const KEYC_MOUSEDRAG9_PANE: C2RustUnnamed_35 = 1106153;
pub const KEYC_MOUSEDRAG8_BORDER: C2RustUnnamed_35 = 1106152;
pub const KEYC_MOUSEDRAG8_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106151;
pub const KEYC_MOUSEDRAG8_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106150;
pub const KEYC_MOUSEDRAG8_SCROLLBAR_UP: C2RustUnnamed_35 = 1106149;
pub const KEYC_MOUSEDRAG8_STATUS_DEFAULT: C2RustUnnamed_35 = 1106148;
pub const KEYC_MOUSEDRAG8_STATUS_RIGHT: C2RustUnnamed_35 = 1106147;
pub const KEYC_MOUSEDRAG8_STATUS_LEFT: C2RustUnnamed_35 = 1106146;
pub const KEYC_MOUSEDRAG8_STATUS: C2RustUnnamed_35 = 1106145;
pub const KEYC_MOUSEDRAG8_PANE: C2RustUnnamed_35 = 1106144;
pub const KEYC_MOUSEDRAG7_BORDER: C2RustUnnamed_35 = 1106143;
pub const KEYC_MOUSEDRAG7_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106142;
pub const KEYC_MOUSEDRAG7_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106141;
pub const KEYC_MOUSEDRAG7_SCROLLBAR_UP: C2RustUnnamed_35 = 1106140;
pub const KEYC_MOUSEDRAG7_STATUS_DEFAULT: C2RustUnnamed_35 = 1106139;
pub const KEYC_MOUSEDRAG7_STATUS_RIGHT: C2RustUnnamed_35 = 1106138;
pub const KEYC_MOUSEDRAG7_STATUS_LEFT: C2RustUnnamed_35 = 1106137;
pub const KEYC_MOUSEDRAG7_STATUS: C2RustUnnamed_35 = 1106136;
pub const KEYC_MOUSEDRAG7_PANE: C2RustUnnamed_35 = 1106135;
pub const KEYC_MOUSEDRAG6_BORDER: C2RustUnnamed_35 = 1106134;
pub const KEYC_MOUSEDRAG6_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106133;
pub const KEYC_MOUSEDRAG6_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106132;
pub const KEYC_MOUSEDRAG6_SCROLLBAR_UP: C2RustUnnamed_35 = 1106131;
pub const KEYC_MOUSEDRAG6_STATUS_DEFAULT: C2RustUnnamed_35 = 1106130;
pub const KEYC_MOUSEDRAG6_STATUS_RIGHT: C2RustUnnamed_35 = 1106129;
pub const KEYC_MOUSEDRAG6_STATUS_LEFT: C2RustUnnamed_35 = 1106128;
pub const KEYC_MOUSEDRAG6_STATUS: C2RustUnnamed_35 = 1106127;
pub const KEYC_MOUSEDRAG6_PANE: C2RustUnnamed_35 = 1106126;
pub const KEYC_MOUSEDRAG3_BORDER: C2RustUnnamed_35 = 1106125;
pub const KEYC_MOUSEDRAG3_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106124;
pub const KEYC_MOUSEDRAG3_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106123;
pub const KEYC_MOUSEDRAG3_SCROLLBAR_UP: C2RustUnnamed_35 = 1106122;
pub const KEYC_MOUSEDRAG3_STATUS_DEFAULT: C2RustUnnamed_35 = 1106121;
pub const KEYC_MOUSEDRAG3_STATUS_RIGHT: C2RustUnnamed_35 = 1106120;
pub const KEYC_MOUSEDRAG3_STATUS_LEFT: C2RustUnnamed_35 = 1106119;
pub const KEYC_MOUSEDRAG3_STATUS: C2RustUnnamed_35 = 1106118;
pub const KEYC_MOUSEDRAG3_PANE: C2RustUnnamed_35 = 1106117;
pub const KEYC_MOUSEDRAG2_BORDER: C2RustUnnamed_35 = 1106116;
pub const KEYC_MOUSEDRAG2_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106115;
pub const KEYC_MOUSEDRAG2_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106114;
pub const KEYC_MOUSEDRAG2_SCROLLBAR_UP: C2RustUnnamed_35 = 1106113;
pub const KEYC_MOUSEDRAG2_STATUS_DEFAULT: C2RustUnnamed_35 = 1106112;
pub const KEYC_MOUSEDRAG2_STATUS_RIGHT: C2RustUnnamed_35 = 1106111;
pub const KEYC_MOUSEDRAG2_STATUS_LEFT: C2RustUnnamed_35 = 1106110;
pub const KEYC_MOUSEDRAG2_STATUS: C2RustUnnamed_35 = 1106109;
pub const KEYC_MOUSEDRAG2_PANE: C2RustUnnamed_35 = 1106108;
pub const KEYC_MOUSEDRAG1_BORDER: C2RustUnnamed_35 = 1106107;
pub const KEYC_MOUSEDRAG1_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106106;
pub const KEYC_MOUSEDRAG1_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106105;
pub const KEYC_MOUSEDRAG1_SCROLLBAR_UP: C2RustUnnamed_35 = 1106104;
pub const KEYC_MOUSEDRAG1_STATUS_DEFAULT: C2RustUnnamed_35 = 1106103;
pub const KEYC_MOUSEDRAG1_STATUS_RIGHT: C2RustUnnamed_35 = 1106102;
pub const KEYC_MOUSEDRAG1_STATUS_LEFT: C2RustUnnamed_35 = 1106101;
pub const KEYC_MOUSEDRAG1_STATUS: C2RustUnnamed_35 = 1106100;
pub const KEYC_MOUSEDRAG1_PANE: C2RustUnnamed_35 = 1106099;
pub const KEYC_MOUSEUP11_BORDER: C2RustUnnamed_35 = 1106098;
pub const KEYC_MOUSEUP11_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106097;
pub const KEYC_MOUSEUP11_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106096;
pub const KEYC_MOUSEUP11_SCROLLBAR_UP: C2RustUnnamed_35 = 1106095;
pub const KEYC_MOUSEUP11_STATUS_DEFAULT: C2RustUnnamed_35 = 1106094;
pub const KEYC_MOUSEUP11_STATUS_RIGHT: C2RustUnnamed_35 = 1106093;
pub const KEYC_MOUSEUP11_STATUS_LEFT: C2RustUnnamed_35 = 1106092;
pub const KEYC_MOUSEUP11_STATUS: C2RustUnnamed_35 = 1106091;
pub const KEYC_MOUSEUP11_PANE: C2RustUnnamed_35 = 1106090;
pub const KEYC_MOUSEUP10_BORDER: C2RustUnnamed_35 = 1106089;
pub const KEYC_MOUSEUP10_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106088;
pub const KEYC_MOUSEUP10_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106087;
pub const KEYC_MOUSEUP10_SCROLLBAR_UP: C2RustUnnamed_35 = 1106086;
pub const KEYC_MOUSEUP10_STATUS_DEFAULT: C2RustUnnamed_35 = 1106085;
pub const KEYC_MOUSEUP10_STATUS_RIGHT: C2RustUnnamed_35 = 1106084;
pub const KEYC_MOUSEUP10_STATUS_LEFT: C2RustUnnamed_35 = 1106083;
pub const KEYC_MOUSEUP10_STATUS: C2RustUnnamed_35 = 1106082;
pub const KEYC_MOUSEUP10_PANE: C2RustUnnamed_35 = 1106081;
pub const KEYC_MOUSEUP9_BORDER: C2RustUnnamed_35 = 1106080;
pub const KEYC_MOUSEUP9_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106079;
pub const KEYC_MOUSEUP9_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106078;
pub const KEYC_MOUSEUP9_SCROLLBAR_UP: C2RustUnnamed_35 = 1106077;
pub const KEYC_MOUSEUP9_STATUS_DEFAULT: C2RustUnnamed_35 = 1106076;
pub const KEYC_MOUSEUP9_STATUS_RIGHT: C2RustUnnamed_35 = 1106075;
pub const KEYC_MOUSEUP9_STATUS_LEFT: C2RustUnnamed_35 = 1106074;
pub const KEYC_MOUSEUP9_STATUS: C2RustUnnamed_35 = 1106073;
pub const KEYC_MOUSEUP9_PANE: C2RustUnnamed_35 = 1106072;
pub const KEYC_MOUSEUP8_BORDER: C2RustUnnamed_35 = 1106071;
pub const KEYC_MOUSEUP8_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106070;
pub const KEYC_MOUSEUP8_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106069;
pub const KEYC_MOUSEUP8_SCROLLBAR_UP: C2RustUnnamed_35 = 1106068;
pub const KEYC_MOUSEUP8_STATUS_DEFAULT: C2RustUnnamed_35 = 1106067;
pub const KEYC_MOUSEUP8_STATUS_RIGHT: C2RustUnnamed_35 = 1106066;
pub const KEYC_MOUSEUP8_STATUS_LEFT: C2RustUnnamed_35 = 1106065;
pub const KEYC_MOUSEUP8_STATUS: C2RustUnnamed_35 = 1106064;
pub const KEYC_MOUSEUP8_PANE: C2RustUnnamed_35 = 1106063;
pub const KEYC_MOUSEUP7_BORDER: C2RustUnnamed_35 = 1106062;
pub const KEYC_MOUSEUP7_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106061;
pub const KEYC_MOUSEUP7_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106060;
pub const KEYC_MOUSEUP7_SCROLLBAR_UP: C2RustUnnamed_35 = 1106059;
pub const KEYC_MOUSEUP7_STATUS_DEFAULT: C2RustUnnamed_35 = 1106058;
pub const KEYC_MOUSEUP7_STATUS_RIGHT: C2RustUnnamed_35 = 1106057;
pub const KEYC_MOUSEUP7_STATUS_LEFT: C2RustUnnamed_35 = 1106056;
pub const KEYC_MOUSEUP7_STATUS: C2RustUnnamed_35 = 1106055;
pub const KEYC_MOUSEUP7_PANE: C2RustUnnamed_35 = 1106054;
pub const KEYC_MOUSEUP6_BORDER: C2RustUnnamed_35 = 1106053;
pub const KEYC_MOUSEUP6_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106052;
pub const KEYC_MOUSEUP6_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106051;
pub const KEYC_MOUSEUP6_SCROLLBAR_UP: C2RustUnnamed_35 = 1106050;
pub const KEYC_MOUSEUP6_STATUS_DEFAULT: C2RustUnnamed_35 = 1106049;
pub const KEYC_MOUSEUP6_STATUS_RIGHT: C2RustUnnamed_35 = 1106048;
pub const KEYC_MOUSEUP6_STATUS_LEFT: C2RustUnnamed_35 = 1106047;
pub const KEYC_MOUSEUP6_STATUS: C2RustUnnamed_35 = 1106046;
pub const KEYC_MOUSEUP6_PANE: C2RustUnnamed_35 = 1106045;
pub const KEYC_MOUSEUP3_BORDER: C2RustUnnamed_35 = 1106044;
pub const KEYC_MOUSEUP3_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106043;
pub const KEYC_MOUSEUP3_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106042;
pub const KEYC_MOUSEUP3_SCROLLBAR_UP: C2RustUnnamed_35 = 1106041;
pub const KEYC_MOUSEUP3_STATUS_DEFAULT: C2RustUnnamed_35 = 1106040;
pub const KEYC_MOUSEUP3_STATUS_RIGHT: C2RustUnnamed_35 = 1106039;
pub const KEYC_MOUSEUP3_STATUS_LEFT: C2RustUnnamed_35 = 1106038;
pub const KEYC_MOUSEUP3_STATUS: C2RustUnnamed_35 = 1106037;
pub const KEYC_MOUSEUP3_PANE: C2RustUnnamed_35 = 1106036;
pub const KEYC_MOUSEUP2_BORDER: C2RustUnnamed_35 = 1106035;
pub const KEYC_MOUSEUP2_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106034;
pub const KEYC_MOUSEUP2_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106033;
pub const KEYC_MOUSEUP2_SCROLLBAR_UP: C2RustUnnamed_35 = 1106032;
pub const KEYC_MOUSEUP2_STATUS_DEFAULT: C2RustUnnamed_35 = 1106031;
pub const KEYC_MOUSEUP2_STATUS_RIGHT: C2RustUnnamed_35 = 1106030;
pub const KEYC_MOUSEUP2_STATUS_LEFT: C2RustUnnamed_35 = 1106029;
pub const KEYC_MOUSEUP2_STATUS: C2RustUnnamed_35 = 1106028;
pub const KEYC_MOUSEUP2_PANE: C2RustUnnamed_35 = 1106027;
pub const KEYC_MOUSEUP1_BORDER: C2RustUnnamed_35 = 1106026;
pub const KEYC_MOUSEUP1_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106025;
pub const KEYC_MOUSEUP1_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106024;
pub const KEYC_MOUSEUP1_SCROLLBAR_UP: C2RustUnnamed_35 = 1106023;
pub const KEYC_MOUSEUP1_STATUS_DEFAULT: C2RustUnnamed_35 = 1106022;
pub const KEYC_MOUSEUP1_STATUS_RIGHT: C2RustUnnamed_35 = 1106021;
pub const KEYC_MOUSEUP1_STATUS_LEFT: C2RustUnnamed_35 = 1106020;
pub const KEYC_MOUSEUP1_STATUS: C2RustUnnamed_35 = 1106019;
pub const KEYC_MOUSEUP1_PANE: C2RustUnnamed_35 = 1106018;
pub const KEYC_MOUSEDOWN11_BORDER: C2RustUnnamed_35 = 1106017;
pub const KEYC_MOUSEDOWN11_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106016;
pub const KEYC_MOUSEDOWN11_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106015;
pub const KEYC_MOUSEDOWN11_SCROLLBAR_UP: C2RustUnnamed_35 = 1106014;
pub const KEYC_MOUSEDOWN11_STATUS_DEFAULT: C2RustUnnamed_35 = 1106013;
pub const KEYC_MOUSEDOWN11_STATUS_RIGHT: C2RustUnnamed_35 = 1106012;
pub const KEYC_MOUSEDOWN11_STATUS_LEFT: C2RustUnnamed_35 = 1106011;
pub const KEYC_MOUSEDOWN11_STATUS: C2RustUnnamed_35 = 1106010;
pub const KEYC_MOUSEDOWN11_PANE: C2RustUnnamed_35 = 1106009;
pub const KEYC_MOUSEDOWN10_BORDER: C2RustUnnamed_35 = 1106008;
pub const KEYC_MOUSEDOWN10_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1106007;
pub const KEYC_MOUSEDOWN10_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1106006;
pub const KEYC_MOUSEDOWN10_SCROLLBAR_UP: C2RustUnnamed_35 = 1106005;
pub const KEYC_MOUSEDOWN10_STATUS_DEFAULT: C2RustUnnamed_35 = 1106004;
pub const KEYC_MOUSEDOWN10_STATUS_RIGHT: C2RustUnnamed_35 = 1106003;
pub const KEYC_MOUSEDOWN10_STATUS_LEFT: C2RustUnnamed_35 = 1106002;
pub const KEYC_MOUSEDOWN10_STATUS: C2RustUnnamed_35 = 1106001;
pub const KEYC_MOUSEDOWN10_PANE: C2RustUnnamed_35 = 1106000;
pub const KEYC_MOUSEDOWN9_BORDER: C2RustUnnamed_35 = 1105999;
pub const KEYC_MOUSEDOWN9_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1105998;
pub const KEYC_MOUSEDOWN9_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1105997;
pub const KEYC_MOUSEDOWN9_SCROLLBAR_UP: C2RustUnnamed_35 = 1105996;
pub const KEYC_MOUSEDOWN9_STATUS_DEFAULT: C2RustUnnamed_35 = 1105995;
pub const KEYC_MOUSEDOWN9_STATUS_RIGHT: C2RustUnnamed_35 = 1105994;
pub const KEYC_MOUSEDOWN9_STATUS_LEFT: C2RustUnnamed_35 = 1105993;
pub const KEYC_MOUSEDOWN9_STATUS: C2RustUnnamed_35 = 1105992;
pub const KEYC_MOUSEDOWN9_PANE: C2RustUnnamed_35 = 1105991;
pub const KEYC_MOUSEDOWN8_BORDER: C2RustUnnamed_35 = 1105990;
pub const KEYC_MOUSEDOWN8_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1105989;
pub const KEYC_MOUSEDOWN8_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1105988;
pub const KEYC_MOUSEDOWN8_SCROLLBAR_UP: C2RustUnnamed_35 = 1105987;
pub const KEYC_MOUSEDOWN8_STATUS_DEFAULT: C2RustUnnamed_35 = 1105986;
pub const KEYC_MOUSEDOWN8_STATUS_RIGHT: C2RustUnnamed_35 = 1105985;
pub const KEYC_MOUSEDOWN8_STATUS_LEFT: C2RustUnnamed_35 = 1105984;
pub const KEYC_MOUSEDOWN8_STATUS: C2RustUnnamed_35 = 1105983;
pub const KEYC_MOUSEDOWN8_PANE: C2RustUnnamed_35 = 1105982;
pub const KEYC_MOUSEDOWN7_BORDER: C2RustUnnamed_35 = 1105981;
pub const KEYC_MOUSEDOWN7_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1105980;
pub const KEYC_MOUSEDOWN7_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1105979;
pub const KEYC_MOUSEDOWN7_SCROLLBAR_UP: C2RustUnnamed_35 = 1105978;
pub const KEYC_MOUSEDOWN7_STATUS_DEFAULT: C2RustUnnamed_35 = 1105977;
pub const KEYC_MOUSEDOWN7_STATUS_RIGHT: C2RustUnnamed_35 = 1105976;
pub const KEYC_MOUSEDOWN7_STATUS_LEFT: C2RustUnnamed_35 = 1105975;
pub const KEYC_MOUSEDOWN7_STATUS: C2RustUnnamed_35 = 1105974;
pub const KEYC_MOUSEDOWN7_PANE: C2RustUnnamed_35 = 1105973;
pub const KEYC_MOUSEDOWN6_BORDER: C2RustUnnamed_35 = 1105972;
pub const KEYC_MOUSEDOWN6_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1105971;
pub const KEYC_MOUSEDOWN6_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1105970;
pub const KEYC_MOUSEDOWN6_SCROLLBAR_UP: C2RustUnnamed_35 = 1105969;
pub const KEYC_MOUSEDOWN6_STATUS_DEFAULT: C2RustUnnamed_35 = 1105968;
pub const KEYC_MOUSEDOWN6_STATUS_RIGHT: C2RustUnnamed_35 = 1105967;
pub const KEYC_MOUSEDOWN6_STATUS_LEFT: C2RustUnnamed_35 = 1105966;
pub const KEYC_MOUSEDOWN6_STATUS: C2RustUnnamed_35 = 1105965;
pub const KEYC_MOUSEDOWN6_PANE: C2RustUnnamed_35 = 1105964;
pub const KEYC_MOUSEDOWN3_BORDER: C2RustUnnamed_35 = 1105963;
pub const KEYC_MOUSEDOWN3_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1105962;
pub const KEYC_MOUSEDOWN3_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1105961;
pub const KEYC_MOUSEDOWN3_SCROLLBAR_UP: C2RustUnnamed_35 = 1105960;
pub const KEYC_MOUSEDOWN3_STATUS_DEFAULT: C2RustUnnamed_35 = 1105959;
pub const KEYC_MOUSEDOWN3_STATUS_RIGHT: C2RustUnnamed_35 = 1105958;
pub const KEYC_MOUSEDOWN3_STATUS_LEFT: C2RustUnnamed_35 = 1105957;
pub const KEYC_MOUSEDOWN3_STATUS: C2RustUnnamed_35 = 1105956;
pub const KEYC_MOUSEDOWN3_PANE: C2RustUnnamed_35 = 1105955;
pub const KEYC_MOUSEDOWN2_BORDER: C2RustUnnamed_35 = 1105954;
pub const KEYC_MOUSEDOWN2_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1105953;
pub const KEYC_MOUSEDOWN2_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1105952;
pub const KEYC_MOUSEDOWN2_SCROLLBAR_UP: C2RustUnnamed_35 = 1105951;
pub const KEYC_MOUSEDOWN2_STATUS_DEFAULT: C2RustUnnamed_35 = 1105950;
pub const KEYC_MOUSEDOWN2_STATUS_RIGHT: C2RustUnnamed_35 = 1105949;
pub const KEYC_MOUSEDOWN2_STATUS_LEFT: C2RustUnnamed_35 = 1105948;
pub const KEYC_MOUSEDOWN2_STATUS: C2RustUnnamed_35 = 1105947;
pub const KEYC_MOUSEDOWN2_PANE: C2RustUnnamed_35 = 1105946;
pub const KEYC_MOUSEDOWN1_BORDER: C2RustUnnamed_35 = 1105945;
pub const KEYC_MOUSEDOWN1_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1105944;
pub const KEYC_MOUSEDOWN1_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1105943;
pub const KEYC_MOUSEDOWN1_SCROLLBAR_UP: C2RustUnnamed_35 = 1105942;
pub const KEYC_MOUSEDOWN1_STATUS_DEFAULT: C2RustUnnamed_35 = 1105941;
pub const KEYC_MOUSEDOWN1_STATUS_RIGHT: C2RustUnnamed_35 = 1105940;
pub const KEYC_MOUSEDOWN1_STATUS_LEFT: C2RustUnnamed_35 = 1105939;
pub const KEYC_MOUSEDOWN1_STATUS: C2RustUnnamed_35 = 1105938;
pub const KEYC_MOUSEDOWN1_PANE: C2RustUnnamed_35 = 1105937;
pub const KEYC_MOUSEMOVE_BORDER: C2RustUnnamed_35 = 1105936;
pub const KEYC_MOUSEMOVE_SCROLLBAR_DOWN: C2RustUnnamed_35 = 1105935;
pub const KEYC_MOUSEMOVE_SCROLLBAR_SLIDER: C2RustUnnamed_35 = 1105934;
pub const KEYC_MOUSEMOVE_SCROLLBAR_UP: C2RustUnnamed_35 = 1105933;
pub const KEYC_MOUSEMOVE_STATUS_DEFAULT: C2RustUnnamed_35 = 1105932;
pub const KEYC_MOUSEMOVE_STATUS_RIGHT: C2RustUnnamed_35 = 1105931;
pub const KEYC_MOUSEMOVE_STATUS_LEFT: C2RustUnnamed_35 = 1105930;
pub const KEYC_MOUSEMOVE_STATUS: C2RustUnnamed_35 = 1105929;
pub const KEYC_MOUSEMOVE_PANE: C2RustUnnamed_35 = 1105928;
pub const KEYC_DOUBLECLICK: C2RustUnnamed_35 = 1105927;
pub const KEYC_DRAGGING: C2RustUnnamed_35 = 1105926;
pub const KEYC_MOUSE: C2RustUnnamed_35 = 1105925;
pub const KEYC_PASTE_END: C2RustUnnamed_35 = 1105924;
pub const KEYC_PASTE_START: C2RustUnnamed_35 = 1105923;
pub const KEYC_ANY: C2RustUnnamed_35 = 1105922;
pub const KEYC_FOCUS_OUT: C2RustUnnamed_35 = 1105921;
pub const KEYC_FOCUS_IN: C2RustUnnamed_35 = 1105920;
pub type box_lines = i32;
pub const BOX_LINES_NONE: box_lines = 6;
pub const BOX_LINES_PADDED: box_lines = 5;
pub const BOX_LINES_ROUNDED: box_lines = 4;
pub const BOX_LINES_SIMPLE: box_lines = 3;
pub const BOX_LINES_HEAVY: box_lines = 2;
pub const BOX_LINES_DOUBLE: box_lines = 1;
pub const BOX_LINES_SINGLE: box_lines = 0;
pub const BOX_LINES_DEFAULT: box_lines = -1;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct menu {
    pub title: *const i8,
    pub items: *mut menu_item,
    pub count: u_int,
    pub width: u_int,
}
pub type menu_choice_cb =
    Option<unsafe extern "C" fn(*mut menu, u_int, key_code, *mut libc::c_void) -> ()>;
pub type cmd_parse_status = u32;
pub const CMD_PARSE_SUCCESS: cmd_parse_status = 1;
pub const CMD_PARSE_ERROR: cmd_parse_status = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct cmd_parse_input {
    pub flags: i32,
    pub file: *const i8,
    pub line: u_int,
    pub item: *mut cmdq_item,
    pub c: *mut client,
    pub fs: cmd_find_state,
}
pub type mode_tree_each_cb =
    Option<unsafe extern "C" fn(*mut libc::c_void, *mut libc::c_void, *mut client, key_code) -> ()>;
pub const MODE_TREE_PREVIEW_BIG: mode_tree_preview = 2;
pub const MODE_TREE_PREVIEW_NORMAL: mode_tree_preview = 1;
pub const MODE_TREE_PREVIEW_OFF: mode_tree_preview = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct mode_tree_menu {
    pub data: *mut mode_tree_data,
    pub c: *mut client,
    pub line: u_int,
}
pub type mode_tree_preview = u32;
static mut mode_tree_menu_items: [menu_item; 5] = [
    {
        let mut init = menu_item {
            name: b"Scroll Left\0" as *const u8 as *const i8,
            key: '<' as i32 as key_code,
            command: 0 as *const i8,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"Scroll Right\0" as *const u8 as *const i8,
            key: '>' as i32 as key_code,
            command: 0 as *const i8,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"\0" as *const u8 as *const i8,
            key: 0xff000000000 as u64,
            command: 0 as *const i8,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"Cancel\0" as *const u8 as *const i8,
            key: 'q' as i32 as key_code,
            command: 0 as *const i8,
        };
        init
    },
    {
        let mut init = menu_item {
            name: 0 as *const i8,
            key: 0xff000000000 as u64,
            command: 0 as *const i8,
        };
        init
    },
];
unsafe extern "C" fn mode_tree_find_item(
    mut mtl: *mut mode_tree_list,
    mut tag: uint64_t,
) -> *mut mode_tree_item {
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut child: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    mti = (*mtl).tqh_first;
    while !mti.is_null() {
        if (*mti).tag == tag {
            return mti;
        }
        child = mode_tree_find_item(&mut (*mti).children, tag);
        if !child.is_null() {
            return child;
        }
        mti = (*mti).entry.tqe_next;
    }
    return std::ptr::null_mut::<mode_tree_item>();
}
unsafe extern "C" fn mode_tree_free_item(mut mti: *mut mode_tree_item) {
    mode_tree_free_items(&mut (*mti).children);
    free((*mti).name as *mut libc::c_void);
    free((*mti).text as *mut libc::c_void);
    free((*mti).keystr as *mut libc::c_void);
    free(mti as *mut libc::c_void);
}
unsafe extern "C" fn mode_tree_free_items(mut mtl: *mut mode_tree_list) {
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut mti1: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    mti = (*mtl).tqh_first;
    while !mti.is_null() && {
        mti1 = (*mti).entry.tqe_next;
        1 as i32 != 0
    } {
        if !((*mti).entry.tqe_next).is_null() {
            (*(*mti).entry.tqe_next).entry.tqe_prev = (*mti).entry.tqe_prev;
        } else {
            (*mtl).tqh_last = (*mti).entry.tqe_prev;
        }
        *(*mti).entry.tqe_prev = (*mti).entry.tqe_next;
        mode_tree_free_item(mti);
        mti = mti1;
    }
}
unsafe extern "C" fn mode_tree_check_selected(mut mtd: *mut mode_tree_data) {
    if (*mtd).current > ((*mtd).height).wrapping_sub(1 as i32 as u32) {
        (*mtd).offset = ((*mtd).current)
            .wrapping_sub((*mtd).height)
            .wrapping_add(1 as i32 as u32);
    }
}
unsafe extern "C" fn mode_tree_clear_lines(mut mtd: *mut mode_tree_data) {
    free((*mtd).line_list as *mut libc::c_void);
    (*mtd).line_list = std::ptr::null_mut::<mode_tree_line>();
    (*mtd).line_size = 0 as i32 as u_int;
}
unsafe extern "C" fn mode_tree_build_lines(
    mut mtd: *mut mode_tree_data,
    mut mtl: *mut mode_tree_list,
    mut depth: u_int,
) {
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut line: *mut mode_tree_line = std::ptr::null_mut::<mode_tree_line>();
    let mut i: u_int = 0;
    let mut flat: i32 = 1 as i32;
    (*mtd).depth = depth;
    mti = (*mtl).tqh_first;
    while !mti.is_null() {
        (*mtd).line_list = xreallocarray(
            (*mtd).line_list as *mut libc::c_void,
            ((*mtd).line_size).wrapping_add(1 as i32 as u32) as size_t,
            ::core::mem::size_of::<mode_tree_line>() as u64,
        ) as *mut mode_tree_line;
        let fresh0 = (*mtd).line_size;
        (*mtd).line_size = ((*mtd).line_size).wrapping_add(1);
        line = &mut *((*mtd).line_list).offset(fresh0 as isize) as *mut mode_tree_line;
        (*line).item = mti;
        (*line).depth = depth;
        (*line).last =
            (mti == *(*((*mtl).tqh_last as *mut mode_tree_list)).tqh_last) as i32;
        (*mti).line = ((*mtd).line_size).wrapping_sub(1 as i32 as u32);
        if !((*mti).children.tqh_first).is_null() {
            flat = 0 as i32;
        }
        if (*mti).expanded != 0 {
            mode_tree_build_lines(
                mtd,
                &mut (*mti).children,
                depth.wrapping_add(1 as i32 as u32),
            );
        }
        if ((*mtd).keycb).is_some() {
            (*mti).key = ((*mtd).keycb).expect("non-null function pointer")(
                (*mtd).modedata,
                (*mti).itemdata,
                (*mti).line,
            );
            if (*mti).key == 0xfe000000000 as u64 {
                (*mti).key = 0xff000000000 as u64;
            }
        } else if (*mti).line < 10 as i32 as u32 {
            (*mti).key = ('0' as i32 as u32).wrapping_add((*mti).line) as key_code;
        } else if (*mti).line < 36 as i32 as u32 {
            (*mti).key = 0x100000000000 as u64
                | ('a' as i32 as u32)
                    .wrapping_add((*mti).line)
                    .wrapping_sub(10 as i32 as u32)
                    as u64;
        } else {
            (*mti).key = 0xff000000000 as u64;
        }
        if (*mti).key != 0xff000000000 as u64 {
            (*mti).keystr = xstrdup(key_string_lookup_key((*mti).key, 0 as i32));
            (*mti).keylen = strlen((*mti).keystr);
        } else {
            (*mti).keystr = std::ptr::null::<i8>();
            (*mti).keylen = 0 as i32 as size_t;
        }
        mti = (*mti).entry.tqe_next;
    }
    mti = (*mtl).tqh_first;
    while !mti.is_null() {
        i = 0 as i32 as u_int;
        while i < (*mtd).line_size {
            line = &mut *((*mtd).line_list).offset(i as isize) as *mut mode_tree_line;
            if (*line).item == mti {
                (*line).flat = flat;
            }
            i = i.wrapping_add(1);
        }
        mti = (*mti).entry.tqe_next;
    }
}
unsafe extern "C" fn mode_tree_clear_tagged(mut mtl: *mut mode_tree_list) {
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    mti = (*mtl).tqh_first;
    while !mti.is_null() {
        (*mti).tagged = 0 as i32;
        mode_tree_clear_tagged(&mut (*mti).children);
        mti = (*mti).entry.tqe_next;
    }
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_up(mut mtd: *mut mode_tree_data, mut wrap: i32) {
    if (*mtd).current == 0 as i32 as u32 {
        if wrap != 0 {
            (*mtd).current = ((*mtd).line_size).wrapping_sub(1 as i32 as u32);
            if (*mtd).line_size >= (*mtd).height {
                (*mtd).offset = ((*mtd).line_size).wrapping_sub((*mtd).height);
            }
        }
    } else {
        (*mtd).current = ((*mtd).current).wrapping_sub(1);
        if (*mtd).current < (*mtd).offset {
            (*mtd).offset = ((*mtd).offset).wrapping_sub(1);
        }
    };
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_down(
    mut mtd: *mut mode_tree_data,
    mut wrap: i32,
) -> i32 {
    if (*mtd).current == ((*mtd).line_size).wrapping_sub(1 as i32 as u32) {
        if wrap != 0 {
            (*mtd).current = 0 as i32 as u_int;
            (*mtd).offset = 0 as i32 as u_int;
        } else {
            return 0 as i32;
        }
    } else {
        (*mtd).current = ((*mtd).current).wrapping_add(1);
        if (*mtd).current
            > ((*mtd).offset)
                .wrapping_add((*mtd).height)
                .wrapping_sub(1 as i32 as u32)
        {
            (*mtd).offset = ((*mtd).offset).wrapping_add(1);
        }
    }
    return 1 as i32;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_get_current(mut mtd: *mut mode_tree_data) -> *mut libc::c_void {
    return (*(*((*mtd).line_list).offset((*mtd).current as isize)).item).itemdata;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_get_current_name(
    mut mtd: *mut mode_tree_data,
) -> *const i8 {
    return (*(*((*mtd).line_list).offset((*mtd).current as isize)).item).name;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_expand_current(mut mtd: *mut mode_tree_data) {
    if (*(*((*mtd).line_list).offset((*mtd).current as isize)).item).expanded == 0 {
        (*(*((*mtd).line_list).offset((*mtd).current as isize)).item).expanded = 1 as i32;
        mode_tree_build(mtd);
    }
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_collapse_current(mut mtd: *mut mode_tree_data) {
    if (*(*((*mtd).line_list).offset((*mtd).current as isize)).item).expanded != 0 {
        (*(*((*mtd).line_list).offset((*mtd).current as isize)).item).expanded = 0 as i32;
        mode_tree_build(mtd);
    }
}
unsafe extern "C" fn mode_tree_get_tag(
    mut mtd: *mut mode_tree_data,
    mut tag: uint64_t,
    mut found: *mut u_int,
) -> i32 {
    let mut i: u_int = 0;
    i = 0 as i32 as u_int;
    while i < (*mtd).line_size {
        if (*(*((*mtd).line_list).offset(i as isize)).item).tag == tag {
            break;
        }
        i = i.wrapping_add(1);
    }
    if i != (*mtd).line_size {
        *found = i;
        return 1 as i32;
    }
    return 0 as i32;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_expand(mut mtd: *mut mode_tree_data, mut tag: uint64_t) {
    let mut found: u_int = 0;
    if mode_tree_get_tag(mtd, tag, &mut found) == 0 {
        return;
    }
    if (*(*((*mtd).line_list).offset(found as isize)).item).expanded == 0 {
        (*(*((*mtd).line_list).offset(found as isize)).item).expanded = 1 as i32;
        mode_tree_build(mtd);
    }
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_set_current(
    mut mtd: *mut mode_tree_data,
    mut tag: uint64_t,
) -> i32 {
    let mut found: u_int = 0;
    if mode_tree_get_tag(mtd, tag, &mut found) != 0 {
        (*mtd).current = found;
        if (*mtd).current > ((*mtd).height).wrapping_sub(1 as i32 as u32) {
            (*mtd).offset = ((*mtd).current)
                .wrapping_sub((*mtd).height)
                .wrapping_add(1 as i32 as u32);
        } else {
            (*mtd).offset = 0 as i32 as u_int;
        }
        return 1 as i32;
    }
    if (*mtd).current >= (*mtd).line_size {
        (*mtd).current = ((*mtd).line_size).wrapping_sub(1 as i32 as u32);
        if (*mtd).current > ((*mtd).height).wrapping_sub(1 as i32 as u32) {
            (*mtd).offset = ((*mtd).current)
                .wrapping_sub((*mtd).height)
                .wrapping_add(1 as i32 as u32);
        } else {
            (*mtd).offset = 0 as i32 as u_int;
        }
    }
    return 0 as i32;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_count_tagged(mut mtd: *mut mode_tree_data) -> u_int {
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut i: u_int = 0;
    let mut tagged: u_int = 0;
    tagged = 0 as i32 as u_int;
    i = 0 as i32 as u_int;
    while i < (*mtd).line_size {
        mti = (*((*mtd).line_list).offset(i as isize)).item;
        if (*mti).tagged != 0 {
            tagged = tagged.wrapping_add(1);
        }
        i = i.wrapping_add(1);
    }
    return tagged;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_each_tagged(
    mut mtd: *mut mode_tree_data,
    mut cb: mode_tree_each_cb,
    mut c: *mut client,
    mut key: key_code,
    mut current: i32,
) {
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut i: u_int = 0;
    let mut fired: i32 = 0;
    fired = 0 as i32;
    i = 0 as i32 as u_int;
    while i < (*mtd).line_size {
        mti = (*((*mtd).line_list).offset(i as isize)).item;
        if (*mti).tagged != 0 {
            fired = 1 as i32;
            cb.expect("non-null function pointer")((*mtd).modedata, (*mti).itemdata, c, key);
        }
        i = i.wrapping_add(1);
    }
    if fired == 0 && current != 0 {
        mti = (*((*mtd).line_list).offset((*mtd).current as isize)).item;
        cb.expect("non-null function pointer")((*mtd).modedata, (*mti).itemdata, c, key);
    }
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_start(
    mut wp: *mut window_pane,
    mut args: *mut args,
    mut buildcb: mode_tree_build_cb,
    mut drawcb: mode_tree_draw_cb,
    mut searchcb: mode_tree_search_cb,
    mut menucb: mode_tree_menu_cb,
    mut heightcb: mode_tree_height_cb,
    mut keycb: mode_tree_key_cb,
    mut modedata: *mut libc::c_void,
    mut menu: *const menu_item,
    mut sort_list: *mut *const i8,
    mut sort_size: u_int,
    mut s: *mut *mut screen,
) -> *mut mode_tree_data {
    let mut mtd: *mut mode_tree_data = std::ptr::null_mut::<mode_tree_data>();
    let mut sort: *const i8 = std::ptr::null::<i8>();
    let mut i: u_int = 0;
    mtd = xcalloc(
        1 as i32 as size_t,
        ::core::mem::size_of::<mode_tree_data>() as u64,
    ) as *mut mode_tree_data;
    (*mtd).references = 1 as i32 as u_int;
    (*mtd).wp = wp;
    (*mtd).modedata = modedata;
    (*mtd).menu = menu;
    (*mtd).sort_list = sort_list;
    (*mtd).sort_size = sort_size;
    if args_has(args, 'N' as i32 as u_char) > 1 as i32 {
        (*mtd).preview = MODE_TREE_PREVIEW_BIG as i32;
    } else if args_has(args, 'N' as i32 as u_char) != 0 {
        (*mtd).preview = MODE_TREE_PREVIEW_OFF as i32;
    } else {
        (*mtd).preview = MODE_TREE_PREVIEW_NORMAL as i32;
    }
    sort = args_get(args, 'O' as i32 as u_char);
    if !sort.is_null() {
        i = 0 as i32 as u_int;
        while i < sort_size {
            if strcasecmp(sort, *sort_list.offset(i as isize)) == 0 as i32 {
                (*mtd).sort_crit.field = i;
            }
            i = i.wrapping_add(1);
        }
    }
    (*mtd).sort_crit.reversed = args_has(args, 'r' as i32 as u_char);
    if args_has(args, 'f' as i32 as u_char) != 0 {
        (*mtd).filter = xstrdup(args_get(args, 'f' as i32 as u_char));
    } else {
        (*mtd).filter = std::ptr::null_mut::<i8>();
    }
    (*mtd).buildcb = buildcb;
    (*mtd).drawcb = drawcb;
    (*mtd).searchcb = searchcb;
    (*mtd).menucb = menucb;
    (*mtd).heightcb = heightcb;
    (*mtd).keycb = keycb;
    (*mtd).children.tqh_first = std::ptr::null_mut::<mode_tree_item>();
    (*mtd).children.tqh_last = &mut (*mtd).children.tqh_first;
    *s = &mut (*mtd).screen;
    screen_init(
        *s,
        (*(*wp).base.grid).sx,
        (*(*wp).base.grid).sy,
        0 as i32 as u_int,
    );
    (**s).mode &= !(0x1 as i32);
    return mtd;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_zoom(mut mtd: *mut mode_tree_data, mut args: *mut args) {
    let mut wp: *mut window_pane = (*mtd).wp;
    if args_has(args, 'Z' as i32 as u_char) != 0 {
        (*mtd).zoomed = (*(*wp).window).flags & 0x8 as i32;
        if (*mtd).zoomed == 0 && window_zoom(wp) == 0 as i32 {
            server_redraw_window((*wp).window);
        }
    } else {
        (*mtd).zoomed = -(1 as i32);
    };
}
unsafe extern "C" fn mode_tree_set_height(mut mtd: *mut mode_tree_data) {
    let mut s: *mut screen = &mut (*mtd).screen;
    let mut height: u_int = 0;
    if ((*mtd).heightcb).is_some() {
        height = ((*mtd).heightcb).expect("non-null function pointer")(
            mtd as *mut libc::c_void,
            (*(*s).grid).sy,
        );
        if height < (*(*s).grid).sy {
            (*mtd).height = ((*(*s).grid).sy).wrapping_sub(height);
        }
    } else if (*mtd).preview == MODE_TREE_PREVIEW_NORMAL as i32 {
        (*mtd).height = ((*(*s).grid).sy)
            .wrapping_div(3 as i32 as u32)
            .wrapping_mul(2 as i32 as u32);
        if (*mtd).height > (*mtd).line_size {
            (*mtd).height = ((*(*s).grid).sy).wrapping_div(2 as i32 as u32);
        }
        if (*mtd).height < 10 as i32 as u32 {
            (*mtd).height = (*(*s).grid).sy;
        }
    } else if (*mtd).preview == MODE_TREE_PREVIEW_BIG as i32 {
        (*mtd).height = ((*(*s).grid).sy).wrapping_div(4 as i32 as u32);
        if (*mtd).height > (*mtd).line_size {
            (*mtd).height = (*mtd).line_size;
        }
        if (*mtd).height < 2 as i32 as u32 {
            (*mtd).height = 2 as i32 as u_int;
        }
    } else {
        (*mtd).height = (*(*s).grid).sy;
    }
    if ((*(*s).grid).sy).wrapping_sub((*mtd).height) < 2 as i32 as u32 {
        (*mtd).height = (*(*s).grid).sy;
    }
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_build(mut mtd: *mut mode_tree_data) {
    let mut s: *mut screen = &mut (*mtd).screen;
    let mut tag: uint64_t = 0;
    if !((*mtd).line_list).is_null() {
        tag = (*(*((*mtd).line_list).offset((*mtd).current as isize)).item).tag;
    } else {
        tag = 18446744073709551615 as u64;
    }
    if !((*mtd).children.tqh_first).is_null() {
        *(*mtd).saved.tqh_last = (*mtd).children.tqh_first;
        (*(*mtd).children.tqh_first).entry.tqe_prev = (*mtd).saved.tqh_last;
        (*mtd).saved.tqh_last = (*mtd).children.tqh_last;
        (*mtd).children.tqh_first = std::ptr::null_mut::<mode_tree_item>();
        (*mtd).children.tqh_last = &mut (*mtd).children.tqh_first;
    }
    (*mtd).children.tqh_first = std::ptr::null_mut::<mode_tree_item>();
    (*mtd).children.tqh_last = &mut (*mtd).children.tqh_first;
    ((*mtd).buildcb).expect("non-null function pointer")(
        (*mtd).modedata,
        &mut (*mtd).sort_crit,
        &mut tag,
        (*mtd).filter,
    );
    (*mtd).no_matches = ((*mtd).children.tqh_first
        == std::ptr::null_mut::<libc::c_void>() as *mut mode_tree_item)
        as i32;
    if (*mtd).no_matches != 0 {
        ((*mtd).buildcb).expect("non-null function pointer")(
            (*mtd).modedata,
            &mut (*mtd).sort_crit,
            &mut tag,
            std::ptr::null::<i8>(),
        );
    }
    mode_tree_free_items(&mut (*mtd).saved);
    (*mtd).saved.tqh_first = std::ptr::null_mut::<mode_tree_item>();
    (*mtd).saved.tqh_last = &mut (*mtd).saved.tqh_first;
    mode_tree_clear_lines(mtd);
    mode_tree_build_lines(mtd, &mut (*mtd).children, 0 as i32 as u_int);
    if !((*mtd).line_list).is_null() && tag == 18446744073709551615 as u64 {
        tag = (*(*((*mtd).line_list).offset((*mtd).current as isize)).item).tag;
    }
    mode_tree_set_current(mtd, tag);
    (*mtd).width = (*(*s).grid).sx;
    if (*mtd).preview != MODE_TREE_PREVIEW_OFF as i32 {
        mode_tree_set_height(mtd);
    } else {
        (*mtd).height = (*(*s).grid).sy;
    }
    mode_tree_check_selected(mtd);
}
unsafe extern "C" fn mode_tree_remove_ref(mut mtd: *mut mode_tree_data) {
    (*mtd).references = ((*mtd).references).wrapping_sub(1);
    if (*mtd).references == 0 as i32 as u32 {
        free(mtd as *mut libc::c_void);
    }
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_free(mut mtd: *mut mode_tree_data) {
    let mut wp: *mut window_pane = (*mtd).wp;
    if (*mtd).zoomed == 0 as i32 {
        server_unzoom_window((*wp).window);
    }
    mode_tree_free_items(&mut (*mtd).children);
    mode_tree_clear_lines(mtd);
    screen_free(&mut (*mtd).screen);
    free((*mtd).search as *mut libc::c_void);
    free((*mtd).filter as *mut libc::c_void);
    (*mtd).dead = 1 as i32;
    mode_tree_remove_ref(mtd);
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_resize(
    mut mtd: *mut mode_tree_data,
    mut sx: u_int,
    mut sy: u_int,
) {
    let mut s: *mut screen = &mut (*mtd).screen;
    screen_resize(s, sx, sy, 0 as i32);
    mode_tree_build(mtd);
    mode_tree_draw(mtd);
    (*(*mtd).wp).flags |= 0x1 as i32;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_add(
    mut mtd: *mut mode_tree_data,
    mut parent: *mut mode_tree_item,
    mut itemdata: *mut libc::c_void,
    mut tag: uint64_t,
    mut name: *const i8,
    mut text: *const i8,
    mut expanded: i32,
) -> *mut mode_tree_item {
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut saved: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    log_debug(
        b"%s: %llu, %s %s\0" as *const u8 as *const i8,
        (*::core::mem::transmute::<&[u8; 14], &[i8; 14]>(b"mode_tree_add\0")).as_ptr(),
        tag as u64,
        name,
        if text.is_null() {
            b"\0" as *const u8 as *const i8
        } else {
            text
        },
    );
    mti = xcalloc(
        1 as i32 as size_t,
        ::core::mem::size_of::<mode_tree_item>() as u64,
    ) as *mut mode_tree_item;
    (*mti).parent = parent;
    (*mti).itemdata = itemdata;
    (*mti).tag = tag;
    (*mti).name = xstrdup(name);
    if !text.is_null() {
        (*mti).text = xstrdup(text);
    }
    saved = mode_tree_find_item(&mut (*mtd).saved, tag);
    if !saved.is_null() {
        if parent.is_null() || (*parent).expanded != 0 {
            (*mti).tagged = (*saved).tagged;
        }
        (*mti).expanded = (*saved).expanded;
    } else if expanded == -(1 as i32) {
        (*mti).expanded = 1 as i32;
    } else {
        (*mti).expanded = expanded;
    }
    (*mti).children.tqh_first = std::ptr::null_mut::<mode_tree_item>();
    (*mti).children.tqh_last = &mut (*mti).children.tqh_first;
    if !parent.is_null() {
        (*mti).entry.tqe_next = std::ptr::null_mut::<mode_tree_item>();
        (*mti).entry.tqe_prev = (*parent).children.tqh_last;
        *(*parent).children.tqh_last = mti;
        (*parent).children.tqh_last = &mut (*mti).entry.tqe_next;
    } else {
        (*mti).entry.tqe_next = std::ptr::null_mut::<mode_tree_item>();
        (*mti).entry.tqe_prev = (*mtd).children.tqh_last;
        *(*mtd).children.tqh_last = mti;
        (*mtd).children.tqh_last = &mut (*mti).entry.tqe_next;
    }
    return mti;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_draw_as_parent(mut mti: *mut mode_tree_item) {
    (*mti).draw_as_parent = 1 as i32;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_no_tag(mut mti: *mut mode_tree_item) {
    (*mti).no_tag = 1 as i32;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_remove(
    mut mtd: *mut mode_tree_data,
    mut mti: *mut mode_tree_item,
) {
    let mut parent: *mut mode_tree_item = (*mti).parent;
    if !parent.is_null() {
        if !((*mti).entry.tqe_next).is_null() {
            (*(*mti).entry.tqe_next).entry.tqe_prev = (*mti).entry.tqe_prev;
        } else {
            (*parent).children.tqh_last = (*mti).entry.tqe_prev;
        }
        *(*mti).entry.tqe_prev = (*mti).entry.tqe_next;
    } else {
        if !((*mti).entry.tqe_next).is_null() {
            (*(*mti).entry.tqe_next).entry.tqe_prev = (*mti).entry.tqe_prev;
        } else {
            (*mtd).children.tqh_last = (*mti).entry.tqe_prev;
        }
        *(*mti).entry.tqe_prev = (*mti).entry.tqe_next;
    }
    mode_tree_free_item(mti);
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_draw(mut mtd: *mut mode_tree_data) {
    let mut wp: *mut window_pane = (*mtd).wp;
    let mut s: *mut screen = &mut (*mtd).screen;
    let mut line: *mut mode_tree_line = std::ptr::null_mut::<mode_tree_line>();
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut oo: *mut options = (*(*wp).window).options;
    let mut ctx: screen_write_ctx = screen_write_ctx {
        wp: std::ptr::null_mut::<window_pane>(),
        s: std::ptr::null_mut::<screen>(),
        flags: 0,
        init_ctx_cb: None,
        arg: std::ptr::null_mut::<libc::c_void>(),
        item: std::ptr::null_mut::<screen_write_citem>(),
        scrolled: 0,
        bg: 0,
    };
    let mut gc0: grid_cell = grid_cell {
        data: utf8_data {
            data: [0; 21],
            have: 0,
            size: 0,
            width: 0,
        },
        attr: 0,
        flags: 0,
        fg: 0,
        bg: 0,
        us: 0,
        link: 0,
    };
    let mut gc: grid_cell = grid_cell {
        data: utf8_data {
            data: [0; 21],
            have: 0,
            size: 0,
            width: 0,
        },
        attr: 0,
        flags: 0,
        fg: 0,
        bg: 0,
        us: 0,
        link: 0,
    };
    let mut w: u_int = 0;
    let mut h: u_int = 0;
    let mut i: u_int = 0;
    let mut j: u_int = 0;
    let mut sy: u_int = 0;
    let mut box_x: u_int = 0;
    let mut box_y: u_int = 0;
    let mut width: u_int = 0;
    let mut text: *mut i8 = std::ptr::null_mut::<i8>();
    let mut start: *mut i8 = std::ptr::null_mut::<i8>();
    let mut key: *mut i8 = std::ptr::null_mut::<i8>();
    let mut tag: *const i8 = std::ptr::null::<i8>();
    let mut symbol: *const i8 = std::ptr::null::<i8>();
    let mut size: size_t = 0;
    let mut n: size_t = 0;
    let mut keylen: i32 = 0;
    let mut pad: i32 = 0;
    if (*mtd).line_size == 0 as i32 as u32 {
        return;
    }
    memcpy(
        &mut gc0 as *mut grid_cell as *mut libc::c_void,
        &grid_default_cell as *const grid_cell as *const libc::c_void,
        ::core::mem::size_of::<grid_cell>() as u64,
    );
    memcpy(
        &mut gc as *mut grid_cell as *mut libc::c_void,
        &grid_default_cell as *const grid_cell as *const libc::c_void,
        ::core::mem::size_of::<grid_cell>() as u64,
    );
    style_apply(
        &mut gc,
        oo,
        b"mode-style\0" as *const u8 as *const i8,
        std::ptr::null_mut::<format_tree>(),
    );
    w = (*mtd).width;
    h = (*mtd).height;
    screen_write_start(&mut ctx, s);
    screen_write_clearscreen(&mut ctx, 8 as i32 as u_int);
    keylen = 0 as i32;
    i = 0 as i32 as u_int;
    while i < (*mtd).line_size {
        mti = (*((*mtd).line_list).offset(i as isize)).item;
        if (*mti).key != 0xff000000000 as u64 {
            if (*mti).keylen as i32 + 3 as i32 > keylen {
                keylen =
                    ((*mti).keylen).wrapping_add(3 as i32 as u64) as i32;
            }
        }
        i = i.wrapping_add(1);
    }
    i = 0 as i32 as u_int;
    while i < (*mtd).line_size {
        if i >= (*mtd).offset {
            if i > ((*mtd).offset)
                .wrapping_add(h)
                .wrapping_sub(1 as i32 as u32)
            {
                break;
            }
            line = &mut *((*mtd).line_list).offset(i as isize) as *mut mode_tree_line;
            mti = (*line).item;
            screen_write_cursormove(
                &mut ctx,
                0 as i32,
                i.wrapping_sub((*mtd).offset) as i32,
                0 as i32,
            );
            pad = ((keylen - 2 as i32) as u64).wrapping_sub((*mti).keylen)
                as i32;
            if (*mti).key != 0xff000000000 as u64 {
                xasprintf(
                    &mut key as *mut *mut i8,
                    b"(%s)%*s\0" as *const u8 as *const i8,
                    (*mti).keystr,
                    pad,
                    b"\0" as *const u8 as *const i8,
                );
            } else {
                key = xstrdup(b"\0" as *const u8 as *const i8);
            }
            if (*line).flat != 0 {
                symbol = b"\0" as *const u8 as *const i8;
            } else if ((*mti).children.tqh_first).is_null() {
                symbol = b"  \0" as *const u8 as *const i8;
            } else if (*mti).expanded != 0 {
                symbol = b"- \0" as *const u8 as *const i8;
            } else {
                symbol = b"+ \0" as *const u8 as *const i8;
            }
            if (*line).depth == 0 as i32 as u32 {
                start = xstrdup(symbol);
            } else {
                size = (4 as i32 as u32)
                    .wrapping_mul((*line).depth)
                    .wrapping_add(32 as i32 as u32)
                    as size_t;
                start = xcalloc(1 as i32 as size_t, size) as *mut i8;
                j = 1 as i32 as u_int;
                while j < (*line).depth {
                    if !((*mti).parent).is_null()
                        && (*((*mtd).line_list).offset((*(*mti).parent).line as isize)).last != 0
                    {
                        strlcat(start, b"    \0" as *const u8 as *const i8, size);
                    } else {
                        strlcat(
                            start,
                            b"\x01x\x01   \0" as *const u8 as *const i8,
                            size,
                        );
                    }
                    j = j.wrapping_add(1);
                }
                if (*line).last != 0 {
                    strlcat(
                        start,
                        b"\x01mq\x01> \0" as *const u8 as *const i8,
                        size,
                    );
                } else {
                    strlcat(
                        start,
                        b"\x01tq\x01> \0" as *const u8 as *const i8,
                        size,
                    );
                }
                strlcat(start, symbol, size);
            }
            if (*mti).tagged != 0 {
                tag = b"*\0" as *const u8 as *const i8;
            } else {
                tag = b"\0" as *const u8 as *const i8;
            }
            xasprintf(
                &mut text as *mut *mut i8,
                b"%-*s%s%s%s%s\0" as *const u8 as *const i8,
                keylen,
                key,
                start,
                (*mti).name,
                tag,
                if !((*mti).text).is_null() {
                    b": \0" as *const u8 as *const i8
                } else {
                    b"\0" as *const u8 as *const i8
                },
            );
            width = utf8_cstrwidth(text);
            if width > w {
                width = w;
            }
            free(start as *mut libc::c_void);
            if (*mti).tagged != 0 {
                gc.attr = (gc.attr as i32 ^ 0x1 as i32) as u_short;
                gc0.attr = (gc0.attr as i32 ^ 0x1 as i32) as u_short;
            }
            if i != (*mtd).current {
                screen_write_clearendofline(&mut ctx, 8 as i32 as u_int);
                screen_write_nputs(
                    &mut ctx as *mut screen_write_ctx,
                    w as ssize_t,
                    &mut gc0 as *mut grid_cell,
                    b"%s\0" as *const u8 as *const i8,
                    text,
                );
                if !((*mti).text).is_null() {
                    format_draw(
                        &mut ctx,
                        &mut gc0,
                        w.wrapping_sub(width),
                        (*mti).text,
                        std::ptr::null_mut::<style_ranges>(),
                        0 as i32,
                    );
                }
            } else {
                screen_write_clearendofline(&mut ctx, gc.bg as u_int);
                screen_write_nputs(
                    &mut ctx as *mut screen_write_ctx,
                    w as ssize_t,
                    &mut gc as *mut grid_cell,
                    b"%s\0" as *const u8 as *const i8,
                    text,
                );
                if !((*mti).text).is_null() {
                    format_draw(
                        &mut ctx,
                        &mut gc,
                        w.wrapping_sub(width),
                        (*mti).text,
                        std::ptr::null_mut::<style_ranges>(),
                        0 as i32,
                    );
                }
            }
            free(text as *mut libc::c_void);
            free(key as *mut libc::c_void);
            if (*mti).tagged != 0 {
                gc.attr = (gc.attr as i32 ^ 0x1 as i32) as u_short;
                gc0.attr = (gc0.attr as i32 ^ 0x1 as i32) as u_short;
            }
        }
        i = i.wrapping_add(1);
    }
    if (*mtd).preview != MODE_TREE_PREVIEW_OFF as i32 {
        sy = (*(*s).grid).sy;
        if !(sy <= 4 as i32 as u32
            || h < 2 as i32 as u32
            || sy.wrapping_sub(h) <= 4 as i32 as u32
            || w <= 4 as i32 as u32)
        {
            line = &mut *((*mtd).line_list).offset((*mtd).current as isize) as *mut mode_tree_line;
            mti = (*line).item;
            if (*mti).draw_as_parent != 0 {
                mti = (*mti).parent;
            }
            screen_write_cursormove(
                &mut ctx,
                0 as i32,
                h as i32,
                0 as i32,
            );
            screen_write_box(
                &mut ctx,
                w,
                sy.wrapping_sub(h),
                BOX_LINES_DEFAULT,
                std::ptr::null::<grid_cell>(),
                std::ptr::null::<i8>(),
            );
            if !((*mtd).sort_list).is_null() {
                xasprintf(
                    &mut text as *mut *mut i8,
                    b" %s (sort: %s%s)\0" as *const u8 as *const i8,
                    (*mti).name,
                    *((*mtd).sort_list).offset((*mtd).sort_crit.field as isize),
                    if (*mtd).sort_crit.reversed != 0 {
                        b", reversed\0" as *const u8 as *const i8
                    } else {
                        b"\0" as *const u8 as *const i8
                    },
                );
            } else {
                xasprintf(
                    &mut text as *mut *mut i8,
                    b" %s\0" as *const u8 as *const i8,
                    (*mti).name,
                );
            }
            if w.wrapping_sub(2 as i32 as u32) as u64 >= strlen(text) {
                screen_write_cursormove(
                    &mut ctx,
                    1 as i32,
                    h as i32,
                    0 as i32,
                );
                screen_write_puts(
                    &mut ctx as *mut screen_write_ctx,
                    &mut gc0 as *mut grid_cell,
                    b"%s\0" as *const u8 as *const i8,
                    text,
                );
                if (*mtd).no_matches != 0 {
                    n = (::core::mem::size_of::<[i8; 11]>() as u64)
                        .wrapping_sub(1 as i32 as u64);
                } else {
                    n = (::core::mem::size_of::<[i8; 7]>() as u64)
                        .wrapping_sub(1 as i32 as u64);
                }
                if !((*mtd).filter).is_null()
                    && w.wrapping_sub(2 as i32 as u32) as u64
                        >= (strlen(text))
                            .wrapping_add(10 as i32 as u64)
                            .wrapping_add(n)
                            .wrapping_add(2 as i32 as u64)
                {
                    screen_write_puts(
                        &mut ctx as *mut screen_write_ctx,
                        &mut gc0 as *mut grid_cell,
                        b" (filter: \0" as *const u8 as *const i8,
                    );
                    if (*mtd).no_matches != 0 {
                        screen_write_puts(
                            &mut ctx as *mut screen_write_ctx,
                            &mut gc as *mut grid_cell,
                            b"no matches\0" as *const u8 as *const i8,
                        );
                    } else {
                        screen_write_puts(
                            &mut ctx as *mut screen_write_ctx,
                            &mut gc0 as *mut grid_cell,
                            b"active\0" as *const u8 as *const i8,
                        );
                    }
                    screen_write_puts(
                        &mut ctx as *mut screen_write_ctx,
                        &mut gc0 as *mut grid_cell,
                        b") \0" as *const u8 as *const i8,
                    );
                } else {
                    screen_write_puts(
                        &mut ctx as *mut screen_write_ctx,
                        &mut gc0 as *mut grid_cell,
                        b" \0" as *const u8 as *const i8,
                    );
                }
            }
            free(text as *mut libc::c_void);
            box_x = w.wrapping_sub(4 as i32 as u32);
            box_y = sy
                .wrapping_sub(h)
                .wrapping_sub(2 as i32 as u32);
            if box_x != 0 as i32 as u32
                && box_y != 0 as i32 as u32
            {
                screen_write_cursormove(
                    &mut ctx,
                    2 as i32,
                    h.wrapping_add(1 as i32 as u32) as i32,
                    0 as i32,
                );
                ((*mtd).drawcb).expect("non-null function pointer")(
                    (*mtd).modedata,
                    (*mti).itemdata,
                    &mut ctx,
                    box_x,
                    box_y,
                );
            }
        }
    }
    screen_write_cursormove(
        &mut ctx,
        0 as i32,
        ((*mtd).current).wrapping_sub((*mtd).offset) as i32,
        0 as i32,
    );
    screen_write_stop(&mut ctx);
}
unsafe extern "C" fn mode_tree_search_backward(
    mut mtd: *mut mode_tree_data,
) -> *mut mode_tree_item {
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut last: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut prev: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    if ((*mtd).search).is_null() {
        return std::ptr::null_mut::<mode_tree_item>();
    }
    last = (*((*mtd).line_list).offset((*mtd).current as isize)).item;
    mti = last;
    loop {
        prev = *(*((*mti).entry.tqe_prev as *mut mode_tree_list)).tqh_last;
        if !prev.is_null() {
            while !((*prev).children.tqh_first).is_null() {
                prev = *(*((*prev).children.tqh_last as *mut mode_tree_list)).tqh_last;
            }
            mti = prev;
        } else {
            mti = (*mti).parent;
        }
        if mti.is_null() {
            prev = *(*((*mtd).children.tqh_last as *mut mode_tree_list)).tqh_last;
            while !((*prev).children.tqh_first).is_null() {
                prev = *(*((*prev).children.tqh_last as *mut mode_tree_list)).tqh_last;
            }
            mti = prev;
        }
        if mti == last {
            break;
        }
        if ((*mtd).searchcb).is_none() {
            if !(strstr((*mti).name, (*mtd).search)).is_null() {
                return mti;
            }
        } else if ((*mtd).searchcb).expect("non-null function pointer")(
            (*mtd).modedata,
            (*mti).itemdata,
            (*mtd).search,
        ) != 0
        {
            return mti;
        }
    }
    return std::ptr::null_mut::<mode_tree_item>();
}
unsafe extern "C" fn mode_tree_search_forward(mut mtd: *mut mode_tree_data) -> *mut mode_tree_item {
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut last: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut next: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    if ((*mtd).search).is_null() {
        return std::ptr::null_mut::<mode_tree_item>();
    }
    last = (*((*mtd).line_list).offset((*mtd).current as isize)).item;
    mti = last;
    loop {
        if !((*mti).children.tqh_first).is_null() {
            mti = (*mti).children.tqh_first;
        } else {
            next = (*mti).entry.tqe_next;
            if !next.is_null() {
                mti = next;
            } else {
                loop {
                    mti = (*mti).parent;
                    if mti.is_null() {
                        break;
                    }
                    next = (*mti).entry.tqe_next;
                    if next.is_null() {
                        continue;
                    }
                    mti = next;
                    break;
                }
            }
        }
        if mti.is_null() {
            mti = (*mtd).children.tqh_first;
        }
        if mti == last {
            break;
        }
        if ((*mtd).searchcb).is_none() {
            if !(strstr((*mti).name, (*mtd).search)).is_null() {
                return mti;
            }
        } else if ((*mtd).searchcb).expect("non-null function pointer")(
            (*mtd).modedata,
            (*mti).itemdata,
            (*mtd).search,
        ) != 0
        {
            return mti;
        }
    }
    return std::ptr::null_mut::<mode_tree_item>();
}
unsafe extern "C" fn mode_tree_search_set(mut mtd: *mut mode_tree_data) {
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut loop_0: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut tag: uint64_t = 0;
    if (*mtd).search_dir as u32 == MODE_TREE_SEARCH_FORWARD as i32 as u32
    {
        mti = mode_tree_search_forward(mtd);
    } else {
        mti = mode_tree_search_backward(mtd);
    }
    if mti.is_null() {
        return;
    }
    tag = (*mti).tag;
    loop_0 = (*mti).parent;
    while !loop_0.is_null() {
        (*loop_0).expanded = 1 as i32;
        loop_0 = (*loop_0).parent;
    }
    mode_tree_build(mtd);
    mode_tree_set_current(mtd, tag);
    mode_tree_draw(mtd);
    (*(*mtd).wp).flags |= 0x1 as i32;
}
unsafe extern "C" fn mode_tree_search_callback(
    mut c: *mut client,
    mut data: *mut libc::c_void,
    mut s: *const i8,
    mut done: i32,
) -> i32 {
    let mut mtd: *mut mode_tree_data = data as *mut mode_tree_data;
    if (*mtd).dead != 0 {
        return 0 as i32;
    }
    free((*mtd).search as *mut libc::c_void);
    if s.is_null() || *s as i32 == '\0' as i32 {
        (*mtd).search = std::ptr::null_mut::<i8>();
        return 0 as i32;
    }
    (*mtd).search = xstrdup(s);
    mode_tree_search_set(mtd);
    return 0 as i32;
}
unsafe extern "C" fn mode_tree_search_free(mut data: *mut libc::c_void) {
    mode_tree_remove_ref(data as *mut mode_tree_data);
}
unsafe extern "C" fn mode_tree_filter_callback(
    mut c: *mut client,
    mut data: *mut libc::c_void,
    mut s: *const i8,
    mut done: i32,
) -> i32 {
    let mut mtd: *mut mode_tree_data = data as *mut mode_tree_data;
    if (*mtd).dead != 0 {
        return 0 as i32;
    }
    if !((*mtd).filter).is_null() {
        free((*mtd).filter as *mut libc::c_void);
    }
    if s.is_null() || *s as i32 == '\0' as i32 {
        (*mtd).filter = std::ptr::null_mut::<i8>();
    } else {
        (*mtd).filter = xstrdup(s);
    }
    mode_tree_build(mtd);
    mode_tree_draw(mtd);
    (*(*mtd).wp).flags |= 0x1 as i32;
    return 0 as i32;
}
unsafe extern "C" fn mode_tree_filter_free(mut data: *mut libc::c_void) {
    mode_tree_remove_ref(data as *mut mode_tree_data);
}
unsafe extern "C" fn mode_tree_menu_callback(
    mut menu: *mut menu,
    mut idx: u_int,
    mut key: key_code,
    mut data: *mut libc::c_void,
) {
    let mut mtm: *mut mode_tree_menu = data as *mut mode_tree_menu;
    let mut mtd: *mut mode_tree_data = (*mtm).data;
    if !((*mtd).dead != 0 || key == 0xff000000000 as u64) {
        if (*mtm).line < (*mtd).line_size {
            (*mtd).current = (*mtm).line;
            ((*mtd).menucb).expect("non-null function pointer")((*mtd).modedata, (*mtm).c, key);
        }
    }
    mode_tree_remove_ref(mtd);
    free(mtm as *mut libc::c_void);
}
unsafe extern "C" fn mode_tree_display_menu(
    mut mtd: *mut mode_tree_data,
    mut c: *mut client,
    mut x: u_int,
    mut y: u_int,
    mut outside: i32,
) {
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut menu: *mut menu = std::ptr::null_mut::<menu>();
    let mut items: *const menu_item = std::ptr::null::<menu_item>();
    let mut mtm: *mut mode_tree_menu = std::ptr::null_mut::<mode_tree_menu>();
    let mut title: *mut i8 = std::ptr::null_mut::<i8>();
    let mut line: u_int = 0;
    if ((*mtd).offset).wrapping_add(y)
        > ((*mtd).line_size).wrapping_sub(1 as i32 as u32)
    {
        line = (*mtd).current;
    } else {
        line = ((*mtd).offset).wrapping_add(y);
    }
    mti = (*((*mtd).line_list).offset(line as isize)).item;
    if outside == 0 {
        items = (*mtd).menu;
        xasprintf(
            &mut title as *mut *mut i8,
            b"#[align=centre]%s\0" as *const u8 as *const i8,
            (*mti).name,
        );
    } else {
        items = mode_tree_menu_items.as_ptr();
        title = xstrdup(b"\0" as *const u8 as *const i8);
    }
    menu = menu_create(title);
    menu_add_items(
        menu,
        items,
        std::ptr::null_mut::<cmdq_item>(),
        c,
        std::ptr::null_mut::<cmd_find_state>(),
    );
    free(title as *mut libc::c_void);
    mtm = xmalloc(::core::mem::size_of::<mode_tree_menu>() as u64) as *mut mode_tree_menu;
    (*mtm).data = mtd;
    (*mtm).c = c;
    (*mtm).line = line;
    (*mtd).references = ((*mtd).references).wrapping_add(1);
    if x >= ((*menu).width)
        .wrapping_add(4 as i32 as u32)
        .wrapping_div(2 as i32 as u32)
    {
        x = (x as u32).wrapping_sub(
            ((*menu).width)
                .wrapping_add(4 as i32 as u32)
                .wrapping_div(2 as i32 as u32),
        ) as u_int as u_int;
    } else {
        x = 0 as i32 as u_int;
    }
    if menu_display(
        menu,
        0 as i32,
        0 as i32,
        std::ptr::null_mut::<cmdq_item>(),
        x,
        y,
        c,
        BOX_LINES_DEFAULT,
        std::ptr::null::<i8>(),
        std::ptr::null::<i8>(),
        std::ptr::null::<i8>(),
        std::ptr::null_mut::<cmd_find_state>(),
        Some(
            mode_tree_menu_callback
                as unsafe extern "C" fn(*mut menu, u_int, key_code, *mut libc::c_void) -> (),
        ),
        mtm as *mut libc::c_void,
    ) != 0 as i32
    {
        menu_free(menu);
    }
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_key(
    mut mtd: *mut mode_tree_data,
    mut c: *mut client,
    mut key: *mut key_code,
    mut m: *mut mouse_event,
    mut xp: *mut u_int,
    mut yp: *mut u_int,
) -> i32 {
    let mut line: *mut mode_tree_line = std::ptr::null_mut::<mode_tree_line>();
    let mut current: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut parent: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut mti: *mut mode_tree_item = std::ptr::null_mut::<mode_tree_item>();
    let mut i: u_int = 0;
    let mut x: u_int = 0;
    let mut y: u_int = 0;
    let mut choice: i32 = 0;
    if *key & 0xfffffffffff as u64 >= KEYC_MOUSE as i32 as u64
        && (*key & 0xfffffffffff as u64)
            < KEYC_BSPACE as i32 as u64
        && !m.is_null()
    {
        if cmd_mouse_at((*mtd).wp, m, &mut x, &mut y, 0 as i32) != 0 as i32 {
            *key = 0xff000000000 as u64;
            return 0 as i32;
        }
        if !xp.is_null() {
            *xp = x;
        }
        if !yp.is_null() {
            *yp = y;
        }
        if x > (*mtd).width || y > (*mtd).height {
            if *key == KEYC_MOUSEDOWN3_PANE as i32 as u64 {
                mode_tree_display_menu(mtd, c, x, y, 1 as i32);
            }
            if (*mtd).preview == MODE_TREE_PREVIEW_OFF as i32 {
                *key = 0xff000000000 as u64;
            }
            return 0 as i32;
        }
        if ((*mtd).offset).wrapping_add(y) < (*mtd).line_size {
            if *key == KEYC_MOUSEDOWN1_PANE as i32 as u64
                || *key == KEYC_MOUSEDOWN3_PANE as i32 as u64
                || *key == KEYC_DOUBLECLICK1_PANE as i32 as u64
            {
                (*mtd).current = ((*mtd).offset).wrapping_add(y);
            }
            if *key == KEYC_DOUBLECLICK1_PANE as i32 as u64 {
                *key = '\r' as i32 as key_code;
            } else {
                if *key == KEYC_MOUSEDOWN3_PANE as i32 as u64 {
                    mode_tree_display_menu(mtd, c, x, y, 0 as i32);
                }
                *key = 0xff000000000 as u64;
            }
        } else {
            if *key == KEYC_MOUSEDOWN3_PANE as i32 as u64 {
                mode_tree_display_menu(mtd, c, x, y, 0 as i32);
            }
            *key = 0xff000000000 as u64;
        }
        return 0 as i32;
    }
    line = &mut *((*mtd).line_list).offset((*mtd).current as isize) as *mut mode_tree_line;
    current = (*line).item;
    choice = -(1 as i32);
    i = 0 as i32 as u_int;
    while i < (*mtd).line_size {
        if *key == (*(*((*mtd).line_list).offset(i as isize)).item).key {
            choice = i as i32;
            break;
        } else {
            i = i.wrapping_add(1);
        }
    }
    if choice != -(1 as i32) {
        if choice as u_int > ((*mtd).line_size).wrapping_sub(1 as i32 as u32) {
            *key = 0xff000000000 as u64;
            return 0 as i32;
        }
        (*mtd).current = choice as u_int;
        *key = '\r' as i32 as key_code;
        return 0 as i32;
    }
    match *key {
        113 | 27 | 35184372088935 => return 1 as i32,
        1106542 | 107 | 1106261 | 35184372088944 => {
            mode_tree_up(mtd, 1 as i32);
        }
        1106543 | 106 | 1106270 | 35184372088942 => {
            mode_tree_down(mtd, 1 as i32);
        }
        1106540 | 35184372088930 => {
            i = 0 as i32 as u_int;
            while i < (*mtd).height {
                if (*mtd).current == 0 as i32 as u32 {
                    break;
                }
                mode_tree_up(mtd, 1 as i32);
                i = i.wrapping_add(1);
            }
        }
        1106539 | 35184372088934 => {
            i = 0 as i32 as u_int;
            while i < (*mtd).height {
                if (*mtd).current
                    == ((*mtd).line_size).wrapping_sub(1 as i32 as u32)
                {
                    break;
                }
                mode_tree_down(mtd, 1 as i32);
                i = i.wrapping_add(1);
            }
        }
        103 | 1106537 => {
            (*mtd).current = 0 as i32 as u_int;
            (*mtd).offset = 0 as i32 as u_int;
        }
        71 | 1106538 => {
            (*mtd).current = ((*mtd).line_size).wrapping_sub(1 as i32 as u32);
            if (*mtd).current > ((*mtd).height).wrapping_sub(1 as i32 as u32) {
                (*mtd).offset = ((*mtd).current)
                    .wrapping_sub((*mtd).height)
                    .wrapping_add(1 as i32 as u32);
            } else {
                (*mtd).offset = 0 as i32 as u_int;
            }
        }
        116 => {
            if (*current).no_tag == 0 {
                if (*current).tagged == 0 {
                    parent = (*current).parent;
                    while !parent.is_null() {
                        (*parent).tagged = 0 as i32;
                        parent = (*parent).parent;
                    }
                    mode_tree_clear_tagged(&mut (*current).children);
                    (*current).tagged = 1 as i32;
                } else {
                    (*current).tagged = 0 as i32;
                }
                if !m.is_null() {
                    mode_tree_down(mtd, 0 as i32);
                }
            }
        }
        84 => {
            i = 0 as i32 as u_int;
            while i < (*mtd).line_size {
                (*(*((*mtd).line_list).offset(i as isize)).item).tagged = 0 as i32;
                i = i.wrapping_add(1);
            }
        }
        35184372088948 => {
            i = 0 as i32 as u_int;
            while i < (*mtd).line_size {
                if ((*(*((*mtd).line_list).offset(i as isize)).item).parent).is_null()
                    && (*(*((*mtd).line_list).offset(i as isize)).item).no_tag == 0
                    || !((*(*((*mtd).line_list).offset(i as isize)).item).parent).is_null()
                        && (*(*(*((*mtd).line_list).offset(i as isize)).item).parent).no_tag != 0
                {
                    (*(*((*mtd).line_list).offset(i as isize)).item).tagged = 1 as i32;
                } else {
                    (*(*((*mtd).line_list).offset(i as isize)).item).tagged = 0 as i32;
                }
                i = i.wrapping_add(1);
            }
        }
        79 => {
            (*mtd).sort_crit.field = ((*mtd).sort_crit.field).wrapping_add(1);
            if (*mtd).sort_crit.field >= (*mtd).sort_size {
                (*mtd).sort_crit.field = 0 as i32 as u_int;
            }
            mode_tree_build(mtd);
        }
        114 => {
            (*mtd).sort_crit.reversed = ((*mtd).sort_crit.reversed == 0) as i32;
            mode_tree_build(mtd);
        }
        1106544 | 104 | 45 => {
            if (*line).flat != 0 || (*current).expanded == 0 {
                current = (*current).parent;
            }
            if current.is_null() {
                mode_tree_up(mtd, 0 as i32);
            } else {
                (*current).expanded = 0 as i32;
                (*mtd).current = (*current).line;
                mode_tree_build(mtd);
            }
        }
        1106545 | 108 | 43 => {
            if (*line).flat != 0 || (*current).expanded != 0 {
                mode_tree_down(mtd, 0 as i32);
            } else if (*line).flat == 0 {
                (*current).expanded = 1 as i32;
                mode_tree_build(mtd);
            }
        }
        17592186044461 => {
            mti = (*mtd).children.tqh_first;
            while !mti.is_null() {
                (*mti).expanded = 0 as i32;
                mti = (*mti).entry.tqe_next;
            }
            mode_tree_build(mtd);
        }
        17592186044459 => {
            mti = (*mtd).children.tqh_first;
            while !mti.is_null() {
                (*mti).expanded = 1 as i32;
                mti = (*mti).entry.tqe_next;
            }
            mode_tree_build(mtd);
        }
        63 | 47 | 35184372088947 => {
            (*mtd).references = ((*mtd).references).wrapping_add(1);
            status_prompt_set(
                c,
                std::ptr::null_mut::<cmd_find_state>(),
                b"(search) \0" as *const u8 as *const i8,
                b"\0" as *const u8 as *const i8,
                Some(
                    mode_tree_search_callback
                        as unsafe extern "C" fn(
                            *mut client,
                            *mut libc::c_void,
                            *const i8,
                            i32,
                        ) -> i32,
                ),
                Some(mode_tree_search_free as unsafe extern "C" fn(*mut libc::c_void) -> ()),
                mtd as *mut libc::c_void,
                0x8 as i32,
                PROMPT_TYPE_SEARCH,
            );
        }
        110 => {
            (*mtd).search_dir = MODE_TREE_SEARCH_FORWARD;
            mode_tree_search_set(mtd);
        }
        78 => {
            (*mtd).search_dir = MODE_TREE_SEARCH_BACKWARD;
            mode_tree_search_set(mtd);
        }
        102 => {
            (*mtd).references = ((*mtd).references).wrapping_add(1);
            status_prompt_set(
                c,
                std::ptr::null_mut::<cmd_find_state>(),
                b"(filter) \0" as *const u8 as *const i8,
                (*mtd).filter,
                Some(
                    mode_tree_filter_callback
                        as unsafe extern "C" fn(
                            *mut client,
                            *mut libc::c_void,
                            *const i8,
                            i32,
                        ) -> i32,
                ),
                Some(mode_tree_filter_free as unsafe extern "C" fn(*mut libc::c_void) -> ()),
                mtd as *mut libc::c_void,
                0x8 as i32,
                PROMPT_TYPE_SEARCH,
            );
        }
        118 => {
            match (*mtd).preview {
                0 => {
                    (*mtd).preview = MODE_TREE_PREVIEW_BIG as i32;
                }
                1 => {
                    (*mtd).preview = MODE_TREE_PREVIEW_OFF as i32;
                }
                2 => {
                    (*mtd).preview = MODE_TREE_PREVIEW_NORMAL as i32;
                }
                _ => {}
            }
            mode_tree_build(mtd);
            if (*mtd).preview != MODE_TREE_PREVIEW_OFF as i32 {
                mode_tree_check_selected(mtd);
            }
        }
        _ => {}
    }
    return 0 as i32;
}
#[no_mangle]
pub unsafe extern "C" fn mode_tree_run_command(
    mut c: *mut client,
    mut fs: *mut cmd_find_state,
    mut template: *const i8,
    mut name: *const i8,
) {
    let mut state: *mut cmdq_state = std::ptr::null_mut::<cmdq_state>();
    let mut command: *mut i8 = std::ptr::null_mut::<i8>();
    let mut error: *mut i8 = std::ptr::null_mut::<i8>();
    let mut status: cmd_parse_status = CMD_PARSE_ERROR;
    command = cmd_template_replace(template, name, 1 as i32);
    if !command.is_null() && *command as i32 != '\0' as i32 {
        state = cmdq_new_state(fs, std::ptr::null_mut::<key_event>(), 0 as i32);
        status = cmd_parse_and_append(
            command,
            std::ptr::null_mut::<cmd_parse_input>(),
            c,
            state,
            &mut error,
        );
        if status as u32 == CMD_PARSE_ERROR as i32 as u32 {
            if !c.is_null() {
                *error = toupper(*error as u_char as i32) as i8;
                status_message_set(
                    c,
                    -(1 as i32),
                    1 as i32,
                    0 as i32,
                    b"%s\0" as *const u8 as *const i8,
                    error,
                );
            }
            free(error as *mut libc::c_void);
        }
        cmdq_free_state(state);
    }
    free(command as *mut libc::c_void);
}
